Add programs to compare R8 and ProGuard output sizes
The script r8lib_size_compare.py runs R8 and ProGuard on r8.jar to
produce a minified r8lib.jar that keeps everything marked @Keep.
By default, inlining is disabled in both R8 and ProGuard to make
method-by-method comparison much easier. Pass --inlining to enable
inlining.
By default, the script only shows methods where R8's DEX output is 5 or
more instructions larger than ProGuard+D8's output. Pass --threshold 0
to display all methods.
* Pass extra keyword arguments from build_r8lib() to toolhelper.run() to
allow disabling inlining in R8 by passing the system property
-Dcom.android.tools.r8.disableinlining=1 to the JVM.
Change-Id: I35e2b0742c39a4a09aa61bc2bbc857cca8594843
diff --git a/tools/toolhelper.py b/tools/toolhelper.py
index a7f509c..82a2824 100644
--- a/tools/toolhelper.py
+++ b/tools/toolhelper.py
@@ -9,7 +9,7 @@
import utils
def run(tool, args, build=None, debug=True,
- profile=False, track_memory_file=None):
+ profile=False, track_memory_file=None, extra_args=None):
if build is None:
build, args = extract_build_from_args(args)
if build:
@@ -18,6 +18,8 @@
if track_memory_file:
cmd.extend(['tools/track_memory.sh', track_memory_file])
cmd.append('java')
+ if extra_args:
+ cmd.extend(extra_args)
if debug:
cmd.append('-ea')
if profile: