Open rubenfiszel opened 2 weeks ago
btw did you mean sccache
and not sscache
?
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)
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.
It is still useful to have sccache for cold starts
@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.
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.