Skip to content

Commit 70da8c3

Browse files
author
y-p
committed
BLD: test_perf tweaks
1 parent 8a0c2cc commit 70da8c3

File tree

2 files changed

+19
-30
lines changed

2 files changed

+19
-30
lines changed

test_perf.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,4 @@
33
CURDIR=$(pwd)
44
BASEDIR=$(readlink -f $(dirname $0 ))
55

6-
echo "This script compares the performance of two commits."
7-
echo "Make sure the python 'vbench' library is installed.\n"
8-
echo "Setting the BUILD_CACHE_DIR env var to a temp directory will"
9-
echo "potentially speed up subsequent runs.\n"
10-
11-
12-
#cd "$BASEDIR/vb_suite/"
136
python "$BASEDIR"/vb_suite/test_perf.py $@
14-
15-
#cd "$CURDIR"

vb_suite/test_perf.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
HEAD_COL="head[ms]"
4646
BASE_COL="base[ms]"
4747

48-
parser = argparse.ArgumentParser(description='Use vbench to generate a report comparing performance between two commits.')
48+
parser = argparse.ArgumentParser(description='Use vbench to measure and compare the performance of commits.')
4949
parser.add_argument('-H', '--head',
5050
help='Execute vbenches using the currently checked out copy.',
5151
dest='head',
@@ -64,7 +64,7 @@
6464
parser.add_argument('-o', '--output',
6565
metavar="<file>",
6666
dest='log_file',
67-
help='path of file in which to save the textual report (default: vb_suite.log).')
67+
help='Path of file in which to save the textual report (default: vb_suite.log).')
6868
parser.add_argument('-d', '--outdf',
6969
metavar="FNAME",
7070
dest='outdf',
@@ -74,57 +74,57 @@
7474
metavar="REGEX",
7575
dest='regex',
7676
default="",
77-
help='regex pat, only tests whose name matches the regext will be run.')
77+
help='Regex pat, only tests whose name matches the regext will be run.')
7878
parser.add_argument('-s', '--seed',
7979
metavar="SEED",
8080
dest='seed',
8181
default=1234,
8282
type=int,
83-
help='integer value to seed PRNG with')
83+
help='Integer value to seed PRNG with')
8484
parser.add_argument('-n', '--repeats',
8585
metavar="N",
8686
dest='repeats',
8787
default=3,
8888
type=int,
89-
help='number of times to run each vbench, result value is the best of')
89+
help='Number of times to run each vbench, result value is the best of')
9090
parser.add_argument('-c', '--ncalls',
9191
metavar="N",
9292
dest='ncalls',
9393
default=3,
9494
type=int,
95-
help='number of calls to in each repetition of a vbench')
95+
help='Number of calls to in each repetition of a vbench')
9696
parser.add_argument('-N', '--hrepeats',
9797
metavar="N",
9898
dest='hrepeats',
9999
default=1,
100100
type=int,
101-
help='implies -H, number of times to run the vbench suite on the head\n'
102-
'each iteration will yield another column in the output'
101+
help='Implies -H, number of times to run the vbench suite on the head commit.\n'
102+
'Each iteration will yield another column in the output.'
103103
)
104104
parser.add_argument('-a', '--affinity',
105105
metavar="a",
106106
dest='affinity',
107107
default=1,
108108
type=int,
109-
help='set processor affinity of processm by default bind to cpu/core #1 only'
110-
'requires the "affinity" python module , will raise Warning otherwise' )
109+
help='Set processor affinity of the process. THe default is to bind to cpu/core #1 only.'
110+
'requires the "affinity" python module.' )
111111

112112
parser.add_argument('-u', '--burnin',
113113
metavar="u",
114114
dest='burnin',
115115
default=1,
116116
type=int,
117-
help='number of extra iteration per benchmark to perform first, then throw away. ' )
117+
help='Number of extra iteration per benchmark to perform first, then throw away. ' )
118118

119119
parser.add_argument('-S', '--stats',
120120
default=False,
121121
action='store_true',
122-
help='when specified with -N, prints s.describe() per vbench. ' )
122+
help='when specified with -N, prints the output of describe() per vbench results. ' )
123123

124124
parser.add_argument('-q', '--quiet',
125125
default=False,
126126
action='store_true',
127-
help='suppress report output to stdout. ' )
127+
help='Suppress report output to stdout. ' )
128128

129129
def get_results_df(db, rev):
130130
"""Takes a git commit hash and returns a Dataframe of benchmark results
@@ -189,7 +189,7 @@ def profile_comparative(benchmarks):
189189
prprint('Baseline [%s] : %s\n' % (h_baseline,
190190
repo.messages.get(h_baseline, "")))
191191

192-
prprint("removing any previous measurements for the commits.")
192+
prprint("Removing any previous measurements for the commits.")
193193
db.delete_rev_results(h_baseline)
194194
db.delete_rev_results(h_head)
195195

@@ -394,11 +394,7 @@ def main():
394394
assert affinity.get_process_affinity_mask(0) == args.affinity
395395
print("CPU affinity set to %d" % args.affinity)
396396
except ImportError:
397-
import warnings
398-
print("\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"+
399-
"The 'affinity' module is not available, results may be unreliable\n" +
400-
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n"
401-
)
397+
print("Warning: The 'affinity' module is not available.")
402398
time.sleep(2)
403399

404400
print("\n")
@@ -433,8 +429,10 @@ def main():
433429
# need to be able to reference any commit.
434430
# modified from vbench.git
435431
def _parse_commit_log(this,repo_path,base_commit=None):
436-
from vbench.git import parser, _convert_timezones
432+
from vbench.git import _convert_timezones
437433
from pandas import Series
434+
from dateutil import parser as dparser
435+
438436
git_cmd = 'git --git-dir=%s/.git --work-tree=%s ' % (repo_path, repo_path)
439437
githist = git_cmd + ('log --graph --pretty=format:'+
440438
'\"::%h::%cd::%s::%an\"'+
@@ -455,7 +453,7 @@ def _parse_commit_log(this,repo_path,base_commit=None):
455453
_, sha, stamp, message, author = line.split('::', 4)
456454

457455
# parse timestamp into datetime object
458-
stamp = parser.parse(stamp)
456+
stamp = dparser.parse(stamp)
459457

460458
shas.append(sha)
461459
timestamps.append(stamp)

0 commit comments

Comments
 (0)