@@ -48,13 +48,14 @@ VERBOSE = False
48
48
class DriverArgs (object ):
49
49
"""Arguments for BenchmarkDriver."""
50
50
51
- def __init__ (self , tests , optimization = "O" , architecture = None ):
51
+ def __init__ (self , benchmark_dir , architecture , platform , optimization = "O" ):
52
52
"""Initialize with path to the build-dir and optimization level."""
53
53
self .benchmarks = None
54
54
self .filters = None
55
- self .tests = os .path .join (tests , "bin" )
55
+ self .tests = os .path .join (benchmark_dir , "bin" )
56
56
self .optimization = optimization
57
57
self .architecture = architecture
58
+ self .libdir = os .path .join (benchmark_dir , "lib" , "swift" , platform )
58
59
59
60
60
61
def log (msg ):
@@ -165,7 +166,8 @@ def test_opt_levels(args):
165
166
args .num_samples ,
166
167
args .num_reruns ,
167
168
output_file ,
168
- args .arch
169
+ args .arch ,
170
+ args .platform
169
171
):
170
172
changes = True
171
173
@@ -232,7 +234,7 @@ def merge(results, other_results):
232
234
233
235
def test_performance (
234
236
opt_level , old_dir , new_dir , threshold , num_samples , num_reruns ,
235
- output_file , arch
237
+ output_file , arch , platform
236
238
):
237
239
"""Detect performance changes in benchmarks.
238
240
@@ -242,7 +244,8 @@ def test_performance(
242
244
243
245
i , unchanged_length_count = 0 , 0
244
246
old , new = [
245
- BenchmarkDriver (DriverArgs (dir , optimization = opt_level , architecture = arch ))
247
+ BenchmarkDriver (DriverArgs (dir , architecture = arch , platform = platform ,
248
+ optimization = opt_level ))
246
249
for dir in [old_dir , new_dir ]
247
250
]
248
251
results = [measure (driver , driver .tests , i ) for driver in [old , new ]]
@@ -382,8 +385,10 @@ performance team (@eeckstein).
382
385
383
386
384
387
def check_added (args , output_file = None ):
385
- old = BenchmarkDriver (DriverArgs (args .oldbuilddir [0 ], architecture = args .arch ))
386
- new = BenchmarkDriver (DriverArgs (args .newbuilddir [0 ], architecture = args .arch ))
388
+ old = BenchmarkDriver (DriverArgs (args .oldbuilddir [0 ], architecture = args .arch ,
389
+ platform = args .platform ))
390
+ new = BenchmarkDriver (DriverArgs (args .newbuilddir [0 ], architecture = args .arch ,
391
+ platform = args .platform ))
387
392
added = set (new .tests ).difference (set (old .tests ))
388
393
new .tests = list (added )
389
394
doctor = BenchmarkDoctor (args , driver = new )
0 commit comments