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

feature: use sscache to improve incremental compilation time for rust jobs #4369

Open
rubenfiszel opened this issue Sep 11, 2024 · 6 comments
Assignees

Comments

@rubenfiszel
Copy link
Contributor

No description provided.

@rubenfiszel rubenfiszel self-assigned this Sep 11, 2024
@rubenfiszel rubenfiszel changed the title feature: use sscache to improve incremental compilation time on rust feature: use sscache to improve incremental compilation time for rust jobs Sep 11, 2024
@pyranota
Copy link
Collaborator

Im not sure if sccache will help with incremental compilation. It helps with rebuilding entire project alot, but is not that effective when incrementally rebuilding project with small changes. Sccache caches artifacts, but when we make a change, than produced artifact changes as well and sccache can not provide that new artifact and cache miss occurs. I think the best way to improve comptime speed is to use nightly rust with optimization flags and cranelift as a backend. Still tho approach with sccache should be checked.

@pyranota
Copy link
Collaborator

btw did you mean sccache and not sscache?

@rubenfiszel
Copy link
Contributor Author

Yes I mean sccache.

The reason I thought sccache was useful is in the case where the imports are the same and you did a minor change in your main function. Yes you will need to recompile main but not the imports (but that I'm not sure)

@pyranota
Copy link
Collaborator

Unless these imports are using generics or input data changed (e.g. env variable used to compile subcrate), rust will skip recompilation of those by default. sccache is usually useful only on clean builds. Where rust is smart enough to skip rebuilding same artifacts. If something recompiling, than its more likely that the produced artifact will be different, thus sccache can not provide needed cache.

@pyranota
Copy link
Collaborator

It is still useful to have sccache for cold starts

@rubenfiszel
Copy link
Contributor Author

@pyranota I think you're forgetting that in Windmill, every job has an ephemeral folder and the target of cargo is part of that. So unless I'm mistaken, because the target is deleted after the job, for every job it needs to recompile from start because lack of target folder. sccache primary purpose would be to cache globally those.

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

2 participants