Skip to content

feat: support concurrently handle local plugins launching#263

Closed
bowenliang123 wants to merge 3 commits intolanggenius:mainfrom
bowenliang123:concurrent-local-plugins
Closed

feat: support concurrently handle local plugins launching#263
bowenliang123 wants to merge 3 commits intolanggenius:mainfrom
bowenliang123:concurrent-local-plugins

Conversation

@bowenliang123
Copy link
Copy Markdown
Contributor

@bowenliang123 bowenliang123 commented May 7, 2025

  • Currently, all the local plugins are being checked and initialising the Python environment sequentially. And the pre-compiling each single Python file one by one in the plugin and its dependency in the InitPythonEnvironment method slows the uptime for plugin launching
  • This PR brings concurrency in handling local plugins, which speeds up the plugin launching time dramatically, especially for a new empty plugin-daemon instance.

@bowenliang123 bowenliang123 changed the title support concurrently handle local plugins feat: support concurrently handle local plugins launching May 7, 2025
@Yeuoly
Copy link
Copy Markdown
Contributor

Yeuoly commented May 8, 2025

Actually, concurrently launching was supported already, PluginManager.maxLaunchingLock is what you want, it already limited concurrency of how many plugins could launch at the same time inside launchLocal, just feel free to launch them at the same time, and wait for all of them to finished.

@bowenliang123
Copy link
Copy Markdown
Contributor Author

Actually, concurrently launching was supported already, PluginManager.maxLaunchingLock is what you want, it already limited concurrency of how many plugins could launch at the same time inside launchLocal, just feel free to launch them at the same time, and wait for all of them to finished.

Curious to hear that concurrency has been supported in launching local plugins, while in practise we don't see evidence in concurrently installed and launching local plugins.

And BTW, config.PluginLocalLaunchingConcurrent config is existed but never used across the project without this PR.


var (
waitGroup sync.WaitGroup
semaphores = make(chan struct{}, config.PluginLocalLaunchingConcurrent)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's no need to use semaphores as pluginManager will automatically control its limits

@Yeuoly
Copy link
Copy Markdown
Contributor

Yeuoly commented Nov 18, 2025

Refactored: #499

@Yeuoly Yeuoly closed this Nov 18, 2025
@bowenliang123 bowenliang123 deleted the concurrent-local-plugins branch January 27, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants