Skip to content
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

Up to 4x performance regression compared to c8d7c19 #5502

Closed
kit-ty-kate opened this issue Apr 4, 2023 · 0 comments · Fixed by #5503
Closed

Up to 4x performance regression compared to c8d7c19 #5502

kit-ty-kate opened this issue Apr 4, 2023 · 0 comments · Fixed by #5503

Comments

@kit-ty-kate
Copy link
Member

#5208 made it so that the dependency cone of the switch invariant is recomputed everytime the switch state changes.

The issues is that everytime a package is installed or removed, the switch state is changed so the invariant is recomputed.

This causes a sizeable performance regression for opam remove and opam upgrade (and less sizeable but still there for opam install). For example:

  • with c8d7c19 opam remove -a patdiff takes 8 seconds on my machine
  • after the merge of Compiler packages into invariant packages #5208 it now takes 30 seconds
  • I've tried locally to remove the call to OpamSwitchState.universe from OpamSwitchState.dependencies but it still takes twice the time as before (15 seconds) due to OpamSwitchState.dependencies alone (taking itself between 0.1 and 0.2 seconds per call)

Also, I'm not sure how related this is to the performance issue but I've also noticed that the last dynamic line during opam install/remove (e.g. Processing 80/209: [dune: ocaml 9]) kept blinking and wasn't visible with master (0a174e1) but was always there with c8d7c19.
If this isn't related to the current problem we should create a separate issue to track this.

@kit-ty-kate kit-ty-kate added this to To do in Opam 2.2.0 via automation Apr 4, 2023
@kit-ty-kate kit-ty-kate moved this from To do to After ~alpha; before release in Opam 2.2.0 Apr 4, 2023
Opam 2.2.0 automation moved this from After ~alpha; before release to Done Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Opam 2.2.0
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant