aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/profiling
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-03-29 01:49:02 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-03-29 01:49:02 -0700
commitba32fee3fc2e054ef87148d9027fc08c8c8c37c1 (patch)
treed63419b1a7269bf8158c6bcaf110d545ec008c34 /tools/profiling
parent26cb316227d6b05bac2d083d603bffc8d90f55d5 (diff)
Speed up builds
Diffstat (limited to 'tools/profiling')
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py
index cafb3c1076..ffbdfeb77f 100755
--- a/tools/profiling/microbenchmarks/bm_diff.py
+++ b/tools/profiling/microbenchmarks/bm_diff.py
@@ -95,12 +95,17 @@ def avg(lst):
n += 1
return sum / n
-def collect1(bm, cfg, ver):
- subprocess.check_call(['make', 'clean'])
+def build():
subprocess.check_call(['git', 'submodule', 'update'])
- subprocess.check_call(
- ['make', bm,
- 'CONFIG=%s' % cfg, '-j', '%d' % multiprocessing.cpu_count()])
+ make = ['make'] + args.benchmarks + [
+ 'CONFIG=%s' % cfg, '-j', '%d' % multiprocessing.cpu_count()]
+ try:
+ subprocess.check_call(make)
+ except subprocess.CalledProcessError, e:
+ subprocess.check_call(['make', 'clean'])
+ subprocess.check_call(make)
+
+def collect1(bm, cfg, ver):
cmd = ['bins/%s/%s' % (cfg, bm),
'--benchmark_out=%s.%s.%s.json' % (bm, cfg, ver),
'--benchmark_out_format=json',
@@ -108,6 +113,7 @@ def collect1(bm, cfg, ver):
]
subprocess.check_call(cmd)
+build()
for bm in args.benchmarks:
collect1(bm, 'opt', 'new')
collect1(bm, 'counters', 'new')
@@ -116,6 +122,7 @@ where_am_i = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'
subprocess.check_call(['git', 'checkout', args.diff_base])
try:
+ build()
comparables = []
for bm in args.benchmarks:
try: