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

Delay the creation of the context used when a package failed to build up until the package failed #6278

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link
Member

Noticed while reviewing #6274.
It turns out that we try to fetch the revision of each packages being built even before executing the command, but that information is only used in rare cases so if many git packages are used this can cause some wasted time (not too much, up to a couple seconds on slow hardware with large installs, but not nothing)

Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

The PR contains 2 things: the delay of context creation for package build, and the delay of metadata processes as the sumary is not always printed. PR title is good, but main comment and master changes should contains both. Ideally, 2 commits if it can be easily split.
Otherwise, lgtm!

src/core/opamProcess.ml Outdated Show resolved Hide resolved
@kit-ty-kate kit-ty-kate force-pushed the delay-context-creation branch from c0bcb68 to c73333f Compare January 21, 2025 20:07
Copy link
Member Author

@kit-ty-kate kit-ty-kate left a comment

Choose a reason for hiding this comment

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

The PR contains 2 things: the delay of context creation for package build, and the delay of metadata processes as the sumary is not always printed. PR title is good, but main comment and master changes should contains both. Ideally, 2 commits if it can be easily split.

I don't think those are two separate things. cmd_metadata, p_metadata and r_info are all storing the same things only in three different types. If anything i should be talking about metadata instead of context

@@ -388,7 +395,9 @@ let create ?info_file ?env_file ?(allow_stdin=not Sys.win32) ?stdout_file ?stder
| Some f ->
let chan = open_out f in
let info =
make_info ~cmd ~args ~cwd ~env_file ~stdout_file ~stderr_file ~metadata () in
make_info ~cmd ~args ~cwd ~env_file ~stdout_file ~stderr_file
~metadata:(Lazy.force metadata) ()
Copy link
Member Author

Choose a reason for hiding this comment

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

this is forced too early. I think there is a way to run it only when the process finished

@kit-ty-kate kit-ty-kate added the PR: WIP Not for merge at this stage label Jan 21, 2025
@kit-ty-kate kit-ty-kate marked this pull request as draft January 21, 2025 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: PERFORMANCE PR: WIP Not for merge at this stage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants