-
Notifications
You must be signed in to change notification settings - Fork 469
CI: experiment state cache for incremental build #7360
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
Conversation
36abebb
to
378de02
Compare
Well, there is less boosting than I expected. I may have missed a critical path that stores shared cache.. |
speed test 2
378de02
to
3e8392c
Compare
speed test 1
fe29cef
to
0f4c76c
Compare
Only 15~20% faster with no changes, not so incremental |
Question is if it is worth it then? Also, does it not depend on our opam cache, too? If the opam cache cannot be restored, it could be that we get a newer version of dune and so things might break? |
Yes, it's still a noticeable speedup 👍, I meant "worth it" in terms of CI build issues it might cause. |
Let's see, this should be easy to revert anyway. I'll make it cache based on the master merge. |
Ok, let's go ahead then! |
The compiler build takes up half of the entire CI workflow, and build speed is a huge bottleneck, especially on the Windows runner.
Idea
OCaml has a great incremental build experience. There's no reason why CI can't leverage this too.
In real tests, actions with a
_build
directory cache can be completely omitted if there are no changes. Even if there are some changes, the load is greatly reduced because only minimal work is done along the dependency tree.The build state almost always changes. Therefore, it is important to update it infrequently to find a reasonable hit rate.
We can optionally perform cache writes only on
master
push events. We can even create a "warming job" that updates the shared cache entry once every day or two.