-
Notifications
You must be signed in to change notification settings - Fork 293
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
Optimization for the performance of addModules(), addExplodedModules(), and addFlattenModules() #1770
Conversation
Signed-off-by: edithwuly <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @edithwuly! Just a note to maintainers, we might want to hold this PR until we can update the benchmark suite here to show the impact of this change by using a larger buildpack (the samples one is only a few KB it turns out).
As per usual it seems Codecov is being a bit too picky here... I wonder if there is a way we can get it to ignore error checks, at least on i/o operations 🤔 |
76595b6
to
51f2a82
Compare
Signed-off-by: edithwuly <[email protected]>
@buildpacks/platform-maintainers could you please merge this PR first: #1773 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @edithwuly! Thanks for parallelize the logic for the flatten feature!! ❤️
Summarizing offline discussion - I think we're planning to fold this PR into some work that @jjbustamante is doing (as there will likely be a merge conflict) |
Summary
Reduce the number of times to traverse buildpack bits. Save about 27% time spent on
addExplodedModules()
.Call
NToLayerTar
in goroutine. Save more than half time spent onaddFlattenModules()
.Description
Before
Each buildpack bits will be traversed three times: download, calculate diffID and stream to daemon.
NToLayerTar
inaddFlattenModules()
is called for eachflattenModule
sequentially.After
The diffID of buildpack will calculated while it is downloaded and saved as a tarfile.
NToLayerTar
is called in goroutine, referring to addExplodedModules().Profiling Result
Documentation
Related
Resolves #___