--- a/bench.py Fri May 08 15:18:12 2015 +0800
+++ b/bench.py Fri May 08 15:18:50 2015 +0800
parser.add_argument('--retry', action='store_true', help='try and reduce existing timings')
+def test(mark, mintime=1.0, mintries=3, dropcache=True):
+ cmd = [rel(TESTHGREPO, 'hg'), '-R', TESTREPO]
+ cmd += ['blame', rel(TESTREPO, 'README')]
+ elif mark == 'grepall':
+ cmd += ['grep', '--all', 'version', rel(TESTREPO, 'README')]
+ elif mark == 'grepallf':
+ cmd += ['grep', '--all', '--follow', 'version', rel(TESTREPO, 'README')]
+ cmd += ['status', '--copies', rel(TESTREPO, 'README')]
+ cmd += ['diff', '-r', 'tip~100:tip', rel(TESTREPO, 'README')]
+ cmd += ['diff', '-r', 'tip~100:tip', '--git', rel(TESTREPO, 'README')]
+ elif mark == 'logfile':
+ cmd += ['log', rel(TESTREPO, 'README')]
+ elif mark == 'logfilecp':
+ cmd += ['log', '--copies', rel(TESTREPO, 'README')]
+ elif mark == 'log1000':
+ cmd += ['log', '-l1000']
+ while sum(results) < mintime or len(results) < mintries:
+ shutil.rmtree(rel(TESTREPO, '.hg', 'cache'), ignore_errors=True)
+ subprocess.check_output(cmd)
+ except subprocess.CalledProcessError:
+ results.append(time.time() - start)
cmd = [HG, 'log', '-R', TESTHGREPO, '-T', '{node}\n']
-def test(mark, mintime=1.0, mintries=3, dropcache=True):
- cmd = [rel(TESTHGREPO, 'hg'), '-R', TESTREPO]
- cmd += ['blame', rel(TESTREPO, 'README')]
- elif mark == 'grepall':
- cmd += ['grep', '--all', 'version', rel(TESTREPO, 'README')]
- elif mark == 'grepallf':
- cmd += ['grep', '--all', '--follow', 'version', rel(TESTREPO, 'README')]
- cmd += ['status', '--copies', rel(TESTREPO, 'README')]
- cmd += ['diff', '-r', 'tip~100:tip', rel(TESTREPO, 'README')]
- cmd += ['diff', '-r', 'tip~100:tip', '--git', rel(TESTREPO, 'README')]
- elif mark == 'logfile':
- cmd += ['log', rel(TESTREPO, 'README')]
- elif mark == 'logfilecp':
- cmd += ['log', '--copies', rel(TESTREPO, 'README')]
- elif mark == 'log1000':
- cmd += ['log', '-l1000']
- while sum(results) < mintime or len(results) < mintries:
- shutil.rmtree(rel(TESTREPO, '.hg', 'cache'), ignore_errors=True)
- subprocess.check_output(cmd)
- except subprocess.CalledProcessError:
- results.append(time.time() - start)
subprocess.check_output(['make', '--directory', TESTHGREPO, 'clean'], stderr=subprocess.STDOUT)