Skip to content

[23.0 backport] improve and load plugin command stubs when required - #4141

Merged
thaJeztah merged 2 commits into
docker:23.0from
crazy-max:23.0_backport_fix-perf-reg
Apr 5, 2023
Merged

[23.0 backport] improve and load plugin command stubs when required#4141
thaJeztah merged 2 commits into
docker:23.0from
crazy-max:23.0_backport_fix-perf-reg

Conversation

@crazy-max

@crazy-maxcrazy-max commented Mar 30, 2023

Copy link
Copy Markdown
Member

@thaJeztahthaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
thaJeztah marked this pull request as draft March 30, 2023 23:24
@thaJeztah

Copy link
Copy Markdown
Member

Temporarily moved back to draft, as we need to investigate a possible regression; see #4142 (comment)

We are currently loading plugin command stubs for every
invocation which still has a significant performance hit.
With this change we are doing this operation only if cobra
completion arg request is found.
- 20.10.23: `docker --version` takes ~15ms
- 23.0.1: `docker --version` takes ~93ms
With this change `docker --version` takes ~9ms
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit c39c711)
@crazy-max
crazy-maxforce-pushed the 23.0_backport_fix-perf-reg branch from afec847 to d93d785CompareMarch 31, 2023 14:38
@codecov-commenter

codecov-commenter commented Mar 31, 2023

Copy link
Copy Markdown

Codecov Report

Merging #4141 (c7cdab5) into 23.0 (569dd73) will decrease coverage by 0.05%.
The diff coverage is 24.10%.

Additional details and impacted files
@@ Coverage Diff @@## 23.0 #4141 +/- ##
==========================================
- Coverage 59.14% 59.10% -0.05% 
==========================================
Files 287 287 Lines 24741 24770 +29 ==========================================
+ Hits 14634 14641 +7 - Misses 9221 9242 +21 - Partials 886 887 +1 

@crazy-max

Copy link
Copy Markdown
MemberAuthor

Removed 62f2358 from backport. PR description updated.

@crazy-max
crazy-max marked this pull request as ready for review March 31, 2023 22:04
@crazy-max

crazy-max commented Mar 31, 2023

Copy link
Copy Markdown
MemberAuthor

Moved out of draft if you still wish this for next 23.0

We can slightly improve plugins listing by spawning a
goroutine for each iteration.
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 89583b9)
# Conflicts:
#	vendor.mod
#	vendor/modules.txt
@crazy-max

Copy link
Copy Markdown
MemberAuthor

@thaJeztah Cherry picked #4151 here.

@thaJeztahthaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

I'll wait with merging for now (need to double-check if we want this in the first coming patch release)

@thaJeztahthaJeztah modified the milestones: 23.0.3, 23.0.4Apr 4, 2023
@thaJeztah
thaJeztah merged commit 391b2f0 into docker:23.0Apr 5, 2023
@crazy-max
crazy-max deleted the 23.0_backport_fix-perf-reg branch April 5, 2023 02:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@crazy-max@thaJeztah@codecov-commenter@laurazard