Skip to content
Commit f7141d5a authored by Nan Zhang's avatar Nan Zhang
Browse files

Shard framework during Java compilation for target side.

Performance Compare:
<Unsharded Build------------------------------------------------>
1. Build from clean state
rm -r -f out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

real	1m2.720s user	5m26.604s sys	0m39.552s

2. Incremental build
m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar
&&
touch frameworks/base/core/java/android/net/http/HttpResponseCache.java
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

real	0m37.586s user	5m47.804s sys	0m50.388s

<Sharded Build-------------------------------------------------->
1. Build from clean state
rm -r -f out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

Javac Shard Size: 50----real	1m10.163s user	25m59.008s sys 1m58.460s
Javac Shard Size: 100---real	1m2.115s user	21m3.600s sys 1m15.964s
Javac Shard Size: 150---real	0m59.520s user	18m10.544s sys 1m12.628s
Javac Shard Size: 200---real	0m56.894s user	15m39.244s sys 1m11.608s
Javac Shard Size: 250---real	0m55.991s user	14m38.716s sys	1m2.292s
Javac Shard Size: 300---real	0m55.114s user	13m6.568s sys	1m8.200s
Javac Shard Size: 350---real	0m53.144s user	12m7.740s sys	1m3.836s
Javac Shard Size: 400---real	0m54.929s user	12m9.324s sys	1m4.340s
Javac Shard Size: 450---real	1m30.194s user	25m31.468s sys 1m52.416s
Javac Shard Size: 500---real	0m53.976s user	10m35.500s sys 0m55.160s

2. Incremental build
m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar
&&
touch frameworks/base/core/java/android/net/http/HttpResponseCache.java
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

Javac Shard Size: 50-----real	0m16.322s user	1m8.648s sys 0m31.700s
Javac Shard Size: 100----real	0m16.163s user	1m22.932s sys 0m29.440s
Javac Shard Size: 150----real	0m16.611s user	1m37.828s sys 0m21.168s
Javac Shard Size: 200----real	0m16.936s user	1m49.248s sys 0m28.636s
Javac Shard Size: 250----real	0m17.509s user	1m54.944s sys 0m32.768s
Javac Shard Size: 300----real	0m18.868s user	1m54.088s sys 0m28.824s
Javac Shard Size: 350----real	0m17.629s user	1m54.108s sys 0m31.056s
Javac Shard Size: 400----real	0m18.658s user	2m7.712s sys 0m30.636s
Javac Shard Size: 450----real	0m18.874s user	2m8.808s sys 0m33.540s
Javac Shard Size: 500----real	0m19.432s user	2m24.400s sys 0m30.368s

time m nothing:
real 0m5.799s user 0m7.236s sys 0m3.068s

Test: m clean && m -j checkbuild
Bug: b/67424047

Change-Id: I105733160ef034ec4689259aee30247148ca089c
parent ed8d2363
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment