File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 86
86
dest = 'repeats' ,
87
87
default = 3 ,
88
88
type = int ,
89
- help = 'number of times to run each vbench, result value is the average ' )
89
+ help = 'number of times to run each vbench, result value is the best of ' )
90
90
parser .add_argument ('-c' , '--ncalls' ,
91
91
metavar = "N" ,
92
92
dest = 'ncalls' ,
@@ -131,7 +131,7 @@ def get_results_df(db, rev):
131
131
def prprint (s ):
132
132
print ("*** %s" % s )
133
133
134
- def clear ():
134
+ def pre_hook ():
135
135
import gc
136
136
gc .collect ()
137
137
@@ -143,6 +143,12 @@ def clear():
143
143
except :
144
144
pass
145
145
146
+ gc .disable ()
147
+
148
+ def post_hook ():
149
+ import gc
150
+ gc .enable ()
151
+
146
152
def profile_comparative (benchmarks ):
147
153
148
154
from vbench .api import BenchmarkRunner
@@ -232,8 +238,11 @@ def profile_head_single(benchmark):
232
238
233
239
results = []
234
240
for i in range (N ):
235
- clear ()
241
+ pre_hook () # gc collect then disable
242
+
236
243
d = dict ()
244
+ sys .stdout .write ('.' )
245
+ sys .stdout .flush ()
237
246
try :
238
247
d = benchmark .run ()
239
248
@@ -251,6 +260,8 @@ def profile_head_single(benchmark):
251
260
252
261
results .append (d .get ('timing' ,np .nan ))
253
262
263
+ post_hook () # gc enable
264
+
254
265
if results :
255
266
# throw away the burn_in
256
267
results = results [args .burnin :]
You can’t perform that action at this time.
0 commit comments