perf(jvm): Add option to enable remote cache for intermediate JARs#23408
Open
jgranstrom wants to merge 2 commits into
Open
perf(jvm): Add option to enable remote cache for intermediate JARs#23408jgranstrom wants to merge 2 commits into
jgranstrom wants to merge 2 commits into
Conversation
4742a24 to
140042c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remote caching of all jars was disabled some time ago due to it being slower to fetch from cache than re-executing the process to produce the jar. However, this is not the case if you have a fast remote cache on an internal network in a CI environment, especially when executing a high volume of these tasks. It turns into a bit of a fork bomb on a fully remotely cached run as it has to spawn a ton of tiny processes to construct these jars.
These changes allow enabling remote cache for the intermediate jars, which are both generally small and can be numerous. In my case we have over 1000 compile targets that are going through these processes, and the cost of churning them greatly outweighs going to the remote cache in CI.
This PR:
[jvm].intermediate_jars_remote_cacheoption to enable remote cache of intermediate and intermediate-stripped jars.[jvm].intermediate_jars_remote_cache_speculation_delayto configure a delay before spawning these micro-processes.Here's some benchmarks on 1000+ targets simulating a CI environment where these would be cached remotely but not locally.
(-87%)(-79%)(-71%)(-95%)(-95%)(-99%)(-95%)(-94%)(-81%)(-100%)(-100%)(-82%)(-73%)(-72%)(-84%)(-96%)(-96%)(-97%)(-12%)(-21%)(-10%)