Adding benchmarking script to start monitoring build times #4070
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.
Adds a script to run the gradle-profiler so that we can start monitoring and quantifying build time improvements
Usage
./tools/benchmark/run_benchmark.sh
"comma separated scenario names or blank to run all"`The warm up and run iterations have been reduced from the defaults, makes the overall suite take less time but at the cost some reliability
Here's some early results...
Recompiling
recompiling without any changes takes 1 second~ it's almost entirely gradle configuration, it shows our gradle setup isn't invaliding the configuration and causing extra processing
Clean builds
assemble clean builds with and without the build cache, build cache is disabled by default
From these results we can see that the build cache saves a massive amount of build time, 2m 30s~ down to 14~ seconds, not too unexpected as the build cache doesn't get cleared with a
clean
and since we're only doing a clean we should get lots of cache hits.Incremental
Making a non ABI and ABI change in the matrix sdk module
a 15 second~ incremental time shows us at a high level that the SDK module in correctly compiling incrementally, a clean assembly of the sdk module takes 1 minute~. Bencharking ABI changes will be more useful as we introduce more modules as gradle will force clients of modules with ABI to also recompile.
More information can be found at https://developer.android.com/studio/build/profile-your-build