##// END OF EJS Templates
perf: make sure to explicitly disable any profiler after the first iteration...
marmoute -
r42556:a09829e1 default
parent child Browse files
Show More
@@ -275,6 +275,8 b' class noop(object):'
275 275 def __exit__(self, *args):
276 276 pass
277 277
278 NOOPCTX = noop()
279
278 280 def gettimer(ui, opts=None):
279 281 """return a timer function and formatter: (timer, formatter)
280 282
@@ -405,7 +407,7 b' def _timer(fm, func, setup=None, title=N'
405 407 begin = util.timer()
406 408 count = 0
407 409 if profiler is None:
408 profiler = noop()
410 profiler = NOOPCTX
409 411 for i in xrange(prerun):
410 412 if setup is not None:
411 413 setup()
@@ -417,6 +419,7 b' def _timer(fm, func, setup=None, title=N'
417 419 with profiler:
418 420 with timeone() as item:
419 421 r = func()
422 profiler = NOOPCTX
420 423 count += 1
421 424 results.append(item[0])
422 425 cstop = util.timer()
General Comments 0
You need to be logged in to leave comments. Login now