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
feat: Add --profile
option to lerna exec
and lerna run
#2376
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
evocateur
suggested changes
Dec 15, 2019
This reverts commit 0a440f3.
bweggersen
commented
Dec 16, 2019
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.
Thank you for taking the time to review the PR!!
evocateur
approved these changes
Dec 27, 2019
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.
Looks great, thanks!
evocateur
changed the title
Add Performance Profiler to run and exec
feat: Add Dec 27, 2019
--profile
option to lerna exec
and lerna run
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an option to profile the run and exec commands. It produces a performance profile which can be analyzed using DevTools in a Chromium-based browser.
Description
Profiles the run and exec commands and produces a performance profile which can be analyzed using DevTools in a Chromium-based browser (direct url:
devtools://devtools/bundled/devtools_app.html
). The profile shows a timeline of the operations where each operation is assigned to an open slot. The number of slots is determined by the--concurrency
option and the number of open slots is determined by--concurrency
minus the number of ongoing operations. The end result is a visualization of the parallel execution of your scripts.The default location of the performance profiles is at the root of your project.
Motivation and Context
We have over 200 packages in our repository and we see build time regressions from time to time. Visualizing
lerna run build
helps us uncover obvious mistakes or opportunities for improvement. For instance, in the example above, the final green box in thread 0 depends on the green box immediately preceding it on thread 1 (expanding the threads in the DevTool reveals the name of each package). By splitting the green package on thread 1, we can allow the final package on thread 0 to start much sooner, giving us a performance improvement of ~5 mins on all builds.How Has This Been Tested?
I have tested this locally with all the argument permutations. If we should have some more formal testing of this feature, I would greatly appreciate some guidance on what that could look like.
Types of changes
Checklist: