1 .Dd $Mdocdate: September 22 2011 $
6 .Nd shell script to consistently execute benchmarks
16 utility is a shell script and takes care of some of the
17 grunt work around benchmarking, in order to make it easier
18 to get consistent and comparable benchmark results. Its basic
19 operation is: execute the precommand, then execute and time
20 the command, and do this a set number of iterations, and record
21 the times in a logfile.
26 It executes the precommand and command once without timing it
27 in order to mitigate cold cache effects.
29 It allows a precommand to run before the command, so that the initial
30 state can be set up by the precommand without it being part of the timing
33 It redirects the stdout and stderr to /dev/null so that lots of output
34 going over a network connection doesn't influence timing.
36 It does a sync before running the timed command, and makes sure a final
37 sync is part of the timed command, to make the i/o more consistent.
39 It logs the times of each iteration in an easy-to-parse logfile.
41 It tries to guess a sensible log file name based on the current git
45 The options are as follows:
47 .It Fl n Ar iterations
48 Set the number of iterations to perform, after the initial run.
51 Set the command to run to be timed. This is passed to sh -c, so shell constructs
52 like loops etc. are okay to do. Default: make all.
54 Set the pre-command to run. This command gets run before the timed command in order
55 to make the timed command get a consistent state before it starts.
58 Use the given tag name to modify the logfile that the utility uses
59 to write its results in. The default is just 'time' plus the git branch you
60 are currently on in /usr/src. In order for this to be useful you have to make sure the
61 git branch you are on reflects the system you wish to benchmark of course.
62 The script checks /usr/src/.git even if you are outside the /usr/src hierarchy
66 The script executes the commands the set number of iterations, redirecting stdout
67 and stderr to /dev/null, and records the timed results in the logfile tagged with
72 with the -C option, resulting in printing the 64-bit cpu cycle counter
73 for both HZ-independent high resolution and an easy way not to have to convert minutes
74 and seconds to seconds when parsing the results.
76 You can feed the two separate logfiles directly to
78 to have it tell you the statistical properties of the two datasets, and judge whether
79 there is a statistically significant difference.
81 The default commands, i.e. make all and make clean, can be modified by supplying a MAKE
82 environment variable, so e.g. MAKE=bmake worldstone still does something sensible
83 by default in /usr/pkgsrc directories.