-
Notifications
You must be signed in to change notification settings - Fork 249
[perf] in syncPackagesToProfile, only removeExtraItemsFromProfile is mode is not install #1541
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
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
ef4cd1e
to
9df671e
Compare
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.
What if we reintroduce the heuristic where we only remove extra packages if the counts don't match. Or better yet, only if profile has more than devbox.json
🤔 I think but need to verify that'll break the update scenario where the same package needs to be removed and added from profile |
@mikeland73 looking at this again, I do think the update scenario where the "resolved" store-path of the package has changed will not work if we apply the heuristic. The old heuristic only worked b/c we did add-then-remove, but we now do remove-then-add:
Strictly speaking this also affected the update scenario, but it depends on which store-path got higher priority... I think skipping That said, I want to make this faster for |
6ca1aea
to
52c491b
Compare
9df671e
to
d780346
Compare
52c491b
to
85a4b9a
Compare
d780346
to
538363b
Compare
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.
@savil do you think this is still needed after #1546 ?
This is OK (which is why I'm approving) but it has 2 downsides:
- We no longer fully sync packages on add so if a package is removed manually from devbox.json this won't remove it from profile on add.
- This adds complexity depending on
mode
which makesensure
andsync
harder to reason about.
If after landing #1546 this is still an improvement, lets go for it. But my impression is that removeExtraItemsFromProfile
is probably slow due to search.
Thoughts?
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.
remove
85a4b9a
to
609f2bc
Compare
538363b
to
da47197
Compare
Likely not needed as much. I agree it adds some complexity so avoidable. That said, the complexity is already there for |
Since #1546 needs more work and/or exploration, I'm going to land this. The scenario of a package being added manually in devbox.json, but then not being added via |
Summary
Doing
devbox global add <package>
was taking 9 seconds for me. Most of this timewas spent in
removeExtraPackagesFromProfile
. This operation takes longerbecause it calls
devpkg.NormalizedPackageAttributePath
which callsnix.Search
which is slow.
Instead, I advocate for us to not do this step when adding packages.
How was it tested?
devbox global add <package>
is now snappy