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

add build option to reuse a previous precompile statement file #30746

Closed
wants to merge 1 commit into from

Conversation

KristofferC
Copy link
Sponsor Member

Often, regenerating all precompile statements from scratch is not needed and kind of annoying. During print out of the timing stats for precompile generation, e.g.:

Generating precompile statements... 1083 generated in  96.365000 seconds (overhead  80.354744 seconds)

the "overhead" time is the time spent running everything that generates the statements. The rest of the time is actually including them, which is typically significantly shorter.

This PR saves the precompile statements from a build in a persistent file and one can with a setting in Make.user (JULIA_REUSE_PRECOMPILE=1) chose to use that existing file instead of regenerating a new one. If using the old precompile file fails, a new one will be generated. So reusing the previous one is a bit quicker:

Trying to reuse precompile statements from "C:\\Users\\Kristoffer\\julia\\contrib\\precompile_statements.jl"
1083 precompile statements loaded in  16.833387 seconds

@KristofferC KristofferC added domain:building Build system, or building Julia or its dependencies compiler:precompilation Precompilation of modules labels Jan 17, 2019
@mbauman
Copy link
Sponsor Member

mbauman commented Jan 17, 2019

Is there any reason why this couldn't just be the default behavior?

@vchuravy
Copy link
Sponsor Member

Would be great to have! Especially on slow systems or while debugging system image creation.

@KristofferC
Copy link
Sponsor Member Author

KristofferC commented May 9, 2020

Rebuilt julia far too many times recently. So I rebased this. Saves around a minute per syimage build.

@martinholters
Copy link
Member

Coincidentally came across this while the last line in my terminal reads "Generating precompile statements...". Can we get this forward? Would be really nice.

@ViralBShah
Copy link
Member

Is this worth updating, or can it be closed?

@IanButterworth
Copy link
Sponsor Member

I think this can be closed now that this process is parallelized.

@KristofferC KristofferC closed this Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:precompilation Precompilation of modules domain:building Build system, or building Julia or its dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants