Skip to content

Conversation

@bowenliang123
Copy link
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
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
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
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

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