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

pkg: add argument to pkg lock to print perf stats #11263

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gridbugs
Copy link
Collaborator

@gridbugs gridbugs commented Jan 2, 2025

When doing performance work on the solver it's helpful to see a breakdown of the time spent running the solver vs the time spent updating the package repos. I've also found the number of expanded packages to be both much higher than I expected and highly correlated to the performance runtime (unsurprisingly) so it's included in the stats too.

Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

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

I like the feature, but I would suggest some improvements to make it more reliable and make it a bit less dense in complexity.

bin/pkg/lock.ml Show resolved Hide resolved
bin/pkg/lock.ml Outdated Show resolved Hide resolved
@gridbugs gridbugs force-pushed the pkg-lock-perf-stats branch from 38caebb to 786d112 Compare January 9, 2025 05:43
Copy link
Collaborator

@maiste maiste left a comment

Choose a reason for hiding this comment

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

I add one question but otherwise LFTM 👍

;;

let term =
let+ builder = Common.Builder.term
and+ version_preference = Version_preference.term
and+ lock_dirs_arg = Pkg_common.Lock_dirs_arg.term in
and+ lock_dirs_arg = Pkg_common.Lock_dirs_arg.term
and+ print_perf_stats = Arg.(value & flag & info [ "print-perf-stats" ]) in
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to generalize perf improvement to Dune or just to package management? Otherwise, it can be nice to move it to Common.

Copy link
Collaborator

Choose a reason for hiding this comment

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

IMHO I think for now it's perfectly fine to just improve the locking performance as it is the biggest bottleneck.

@maiste maiste force-pushed the pkg-lock-perf-stats branch from 786d112 to 2054ba4 Compare January 15, 2025 16:06
Sign up for free to 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.

3 participants