Add explicit argument for running on golem
If passed, link in third party dependencies explicitly in scripts and don't build
This will allow for a simplified setup in our performance tracking
Change-Id: I18087187e52cda1f617bc433e97b7b93ecabe03a
diff --git a/tools/run_bootstrap_benchmark.py b/tools/run_bootstrap_benchmark.py
index bfc62e6..ad26959 100755
--- a/tools/run_bootstrap_benchmark.py
+++ b/tools/run_bootstrap_benchmark.py
@@ -3,9 +3,11 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
+import argparse
import os
import sys
+import golem
import minify_tool
import toolhelper
import utils
@@ -13,6 +15,16 @@
PINNED_R8_JAR = os.path.join(utils.REPO_ROOT, 'third_party/r8/r8.jar')
PINNED_PGR8_JAR = os.path.join(utils.REPO_ROOT, 'third_party/r8/r8-pg6.0.1.jar')
+def parse_arguments(argv):
+ parser = argparse.ArgumentParser(
+ description = 'Run r8 bootstrap benchmarks.')
+ parser.add_argument('--golem',
+ help = 'Link in third party dependencies.',
+ default = False,
+ action = 'store_true')
+ return parser.parse_args(argv)
+
+
def dex(input, output):
return_code = toolhelper.run(
'd8', [
@@ -28,6 +40,9 @@
sys.exit(return_code)
if __name__ == '__main__':
+ options = parse_arguments(sys.argv[1:])
+ if options.golem:
+ golem.link_third_party()
with utils.TempDir() as temp:
memory_file = os.path.join(temp, 'memory.dump')
r8_output = os.path.join(temp, 'r8.zip')