Shard srcjars when sharding javac compilation
java_library rules with javac_shard_size set split the sources into shards to invoke javac multiple times, but were using a single javac invocation for all srcjars. For fraemwork-minus-apex, this srcjar shard was the long pole at 15.7 seconds, containing 266 srcjars with 1542 java files with a total of 614593 lines. Use a rough approximation of 5 sources per srcjar to determine the number of shards to split the srcjars into based on javac_shard_size. This results in splitting the srcjars for frameworks-minus-apex into 8 shards, with the longest taking 10.5 seconds to compile. The longest shard contains most of the aidl srcjars, which have been generated by sharded groups of 50 aidl files and have a much higher average number of sources per srcjar (a mean and median of 27). A future improvement could be to shard those separately assuming a higher number of sources per srcjar. Bug: 302033097 Test: USE_RBE=false m frameworks-minus-apex Change-Id: I85e740c7fcf5651cf18c0cdc90ab8c6ee39cb47b
Loading
Please register or sign in to comment