-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance regression on every command invocation #3621
Comments
Copying some details from a slack conversation; From @tonistiigi Basic outline of time spent on CLI redirect(not compose-cli that adds another 100ms):
Sometimes initial binary call(either for docker or plugin) is +100ms. Looks like some macos system cache. The client ping is quick so not necessarily saying the optimization is worth it. all commands except redirect and --version would actually use this result so would need to run it anyway then. avoiding extra metadata call could be nice though Regarding the "metadata"; @thaJeztah: the plug-in election / discovery is going through several directories, and executing each plugin to get the metadata; I recall discussing caching the results with Ian when he was implementing it (we probably should) could be a short TTL for the cache (short being relative; could even be "minutes" @tonistiigi: we could cache the inode+size of the plugin after we have called metadata on it once. next time would just do a stat call and skip metadata if the plugin file has not changed @thaJeztah: Good idea yes. We'd still need to (periodically) scan if new plugins were installed, or if a plugin was installed in a path with a higher priority, but perhaps that in itself isn't the bottleneck (although it depends on how many files are in those directories I guess) @tonistiigi: This already gets called on a specific plugin so new ones would still first get the uncached part. the stat calls that look up the plugin from the list of paths should be fast enough and don’t need to be cached. |
Also encountered this issue with
|
@crazy-max do you think it'd be possible to run a git bisect with that information? (guess that might be tricky as "time taken" may not be an easy one to bisect; perhaps possible though with the right threshold 🤔 |
Here is a quick bench:
|
Not tested but I wonder if completion perf regression being fixed in cobra 1.5.0 could fix this issue: https://github.com/spf13/cobra/releases/tag/v1.5.0 |
This still needs to be looked into. I just compared (note: on different machines, so not a "straight" compare) between 23.0.0 and 20.10; On 20.10:
On 23.0.0:
Notice that |
Results from hyperfine 20.10.23
23.0.0
|
Updated bench results using hyperfine: https://github.com/crazy-max/docker-cli-bench/blob/main/bench.md |
Opened several PRs with different approaches to fix this issue: |
After #3429 every command invocation takes ~200ms longer. Even when command just redirects to another process.
Before:
After:
@ndeloof
The text was updated successfully, but these errors were encountered: