java_tools 10.3 regressed bazel performance, before java_tools javac11 v10.4 improved it.
See original GitHub issueDescription of the problem / feature request:
Our bazel-bench pipeline runs nightly benchmarking of a sample of the bazel commits throughout the day, by using the bazel binaries built at those commits to build the Bazel project itself (bazel build //src:bazel
). We’ve identified the following:
- 5c92b11dc5e1decf1b2a30b72d9bdaaf6e3e4380 regressed wall time by ~48%.
Bazel commit: 5c92b11dc5e1decf1b2a30b72d9bdaaf6e3e4380, Project commit: c282526c071389cd6f88cb77565283b257316267, Project source: https://github.com/bazelbuild/bazel.git
metric mean median stddev pval
wall: 116.968s ( -0.93%) 117.305s ( -0.48%) 2.287s 0.00000
cpu: 79.557s ( +0.29%) 80.480s ( +0.51%) 1.464s 0.40000
system: 19.167s ( -1.83%) 19.240s ( -2.58%) 0.148s 0.40000
memory: 94.667s ( +0.00%) 95.000s ( +0.00%) 0.471s 0.00000
Bazel commit: c282526c071389cd6f88cb77565283b257316267, Project commit: c282526c071389cd6f88cb77565283b257316267, Project source: https://github.com/bazelbuild/bazel.git
metric mean median stddev pval
wall: 173.391s (+48.24%) 173.878s (+48.23%) 1.361s 0.90000
cpu: 81.277s ( +2.16%) 81.930s ( +1.80%) 2.404s 0.40000
system: 18.187s ( -5.11%) 18.450s ( -4.11%) 0.794s 0.40000
memory: 94.000s ( -0.70%) 94.000s ( -1.05%) 0.000s 0.40000
- cd3480e4d53160d20c634134d3917c4e53ac1c49 improved wall time by ~30%.
Bazel commit: 1517286783762647b4922ed1c656262002abedf1, Project commit: 1517286783762647b4922ed1c656262002abedf1, Project source: https://github.com/bazelbuild/bazel.git
metric mean median stddev pval
wall: 184.560s 185.592s 1.563s
cpu: 82.817s 84.350s 2.996s
system: 19.877s 19.230s 1.111s
memory: 95.000MB 95.000MB 0.000MB
Bazel commit: cd3480e4d53160d20c634134d3917c4e53ac1c49, Project commit: 1517286783762647b4922ed1c656262002abedf1, Project source: https://github.com/bazelbuild/bazel.git
metric mean median stddev pval
wall: 128.454s (-30.40%) 129.437s (-30.26%) 1.443s 0.90000
cpu: 86.013s ( +3.86%) 87.650s ( +3.91%) 2.625s 0.40000
system: 20.917s ( +5.23%) 20.820s ( +8.27%) 0.227s 0.40000
memory: 94.000MB ( -1.05%) 94.000MB ( -1.05%) 0.000MB 0.90000
Feature requests: what underlying problem are you trying to solve with this feature?
Maybe we can use this to figure out what in java_tools regressed the performance of Bazel and what corrected it (partially), and whether there’s something more we can do.
What operating system are you running Bazel on?
Ubuntu18.04
Any other information, logs, or outputs that you want to share?
To reproduce, clone bazelbuild/bazel-bench and run:
# 1st benchmark.
bazel run benchmark -- \
--bazel_source=https://github.com/bazelbuild/bazel.git \
--project_source=https://github.com/bazelbuild/bazel.git \
--collect_memory \
--runs=3 \
--bazel_commits=5c92b11dc5e1decf1b2a30b72d9bdaaf6e3e4380,c282526c071389cd6f88cb77565283b257316267 \
--project_commits=c282526c071389cd6f88cb77565283b257316267 \
-- build //src:bazel
# 2nd benchmark
bazel run benchmark -- \
--bazel_source=https://github.com/bazelbuild/bazel.git \
--project_source=https://github.com/bazelbuild/bazel.git \
--collect_memory \
--data_directory=/tmp/.bazel-bench/out \
--runs=3 \
--bazel_commits=1517286783762647b4922ed1c656262002abedf1,cd3480e4d53160d20c634134d3917c4e53ac1c49 \
--project_commits=1517286783762647b4922ed1c656262002abedf1 \
-- build //src:bazel
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Java and Bazel
Use one BUILD file per directory containing Java sources, because this improves build performance. Every BUILD file should contain one java_library rule ...
Read more >Remote Java tools do not work on Windows (unless ... - GitHub
Probably useful: Both the first and second bazel run call JavaBuilder_deploy.jar . JavaBuilder_deploy.jar file has write permissions; The ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
TL;DR culprits were 5c8e584e88 (regression) and a4251eab69 (improvement), both refactoring WorkRequestHandler, but they got into different releases.
Releasing java_tools at: commit 4 no regression
febf4438cd cushon Restore GenClass's --temp_dir flag once more
commit 5 38% regression in wall
5c8e584e88 steinman Move WorkRequestHandler from build jar to Worker package. This is part of the cleanup associated with enabling JSON workers.
commit 8 -26% regression in wall
a4251eab69 steinman Refactor WorkRequestHandler to be an interface, of which Proto is one implementation.
1,38*(1-0.26)=1,02
Thanks @joeleba!
Do I understand correctly that wall time is completely restored? If I get mathematics right: wall * 1.4823 * (1 - 0.3026) = wall * 1.034. So after v10.4 wall is 3.4% bigger? Looking at absolute deltas in wall 173 - 117 = 184 - 128 = 56 they are exactly the same. Set priority back to P1 if you disagree.
I have PR waiting to merge in java_tools v11.0: https://github.com/bazelbuild/bazel/pull/12552
Changelog for v10.3:
Changelog for v10.4:
Potential culprits look to me: 65e818e65b, 5c8e584e88, e68b1e3dd7, a4251eab69
cc @cushon, @susinmotion