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

Cache the "base" sysimage using Scratch.jl #916

Open
KristofferC opened this issue Jan 15, 2024 · 4 comments
Open

Cache the "base" sysimage using Scratch.jl #916

KristofferC opened this issue Jan 15, 2024 · 4 comments

Comments

@KristofferC
Copy link
Member

When creating apps/libraries we first generate a "base" sysimage that does not contain e.g. the precompiled code from the default sysimage that Julia comes bundled with. We could cache that sysimage and reuse it so we do not have to regenerate it over and over.

@sloede
Copy link
Collaborator

sloede commented Jan 15, 2024

That would be a great feature to have! It slightly relates to some of the suggestions in #858. One question that was hard for me to answer though, is how to ensure that the correct cached base sysimage is determined based on the Julia flags (and other environmental variables?). I am thinking that things like -O3 or --check-bounds=yes|no would probably result in different base images.

Also, given that there is (likely) a myriad of different combinations, do we only want to keep the latest cache image or one for each possible feature set? Also, how to prevent race conditions during generation?

@KristofferC
Copy link
Member Author

I think it is fine for code in Base to be compiled with the default arguments. The app/library specific code will then be compiled with whatever specific options are given.

The CPU-target has to be correct though I think.

Also, how to prevent race conditions during generation?

We could have a PID lock for the sysimage being generated.

@sloede
Copy link
Collaborator

sloede commented Jan 15, 2024

I think it is fine for code in Base to be compiled with the default arguments

OK, this makes sense.

We could have a PID lock for the sysimage being generated.

Sounds good.

In general, if we add such a caching feature, it would be good if we can add functions to also remove the cached file and/or force the regeneration of a new file upon next use.

@dhanak
Copy link

dhanak commented Jun 17, 2024

This seems to be a duplicate of #841. I would very much welcome this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants