Skip to content

Commit b49b75e

Browse files
committed
man page, makefile
1 parent f5b40df commit b49b75e

File tree

3 files changed

+255
-0
lines changed

3 files changed

+255
-0
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
docs: \
2+
quickbench.1 \
3+
# quickbench.txt \
4+
# quickbench.info \
5+
6+
quickbench.1: quickbench.1.md Makefile
7+
pandoc -s $< -o $@
8+
9+
#quickbench.txt: quickbench.1 Makefile
10+
# groff -t -e -mandoc -Tascii $< | col -bx >$@
11+
12+
# quickbench.info: quickbench.1.md Makefile
13+
# pandoc $< -t texinfo | makeinfo --force --no-split -o $@

quickbench.1

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
.\" Automatically generated by Pandoc 1.17.1
2+
.\"
3+
.TH "quickbench" "1" "Oct 2016" "quickbench 1.0" ""
4+
.hy
5+
.SH NAME
6+
.PP
7+
quickbench \- quick & easy benchmarking of command\-line programs
8+
.SH SYNOPSIS
9+
.PP
10+
\f[C]quickbench\ [options]\ [<cmd>...]\f[]
11+
.SH DESCRIPTION
12+
.PP
13+
Runs some test commands, possibly with different executables, once or
14+
more and shows their best execution times in tabular format.
15+
.PP
16+
Commands are specified as one or more quote\-enclosed arguments, and/or
17+
one per line in CMDSFILE; or read from a default file [./bench.sh].
18+
.PP
19+
With \-w, commands\[aq] first words are replaced with a new executable
20+
(or multiple comma\-separated executables, showing times for all).
21+
.SH OPTIONS
22+
.TP
23+
.B \f[C]\-f,\ \-\-file\ CMDSFILE\f[]
24+
file containing commands, one per line (\- for stdin)
25+
.RS
26+
.RE
27+
.TP
28+
.B \f[C]\-w,\ \-\-with\ EXE[,...]\f[]
29+
replace first word of commands with these executables
30+
.RS
31+
.RE
32+
.TP
33+
.B \f[C]\-n,\ \-\-iterations=N\f[]
34+
run each test this many times [default: 1]
35+
.RS
36+
.RE
37+
.TP
38+
.B \f[C]\-N,\ \-\-cycles=N\f[]
39+
run the whole suite this many times [default: 1]
40+
.RS
41+
.RE
42+
.TP
43+
.B \f[C]\-p,\ \-\-precision=N\f[]
44+
show times with this many decimal places [default: 2]
45+
.RS
46+
.RE
47+
.TP
48+
.B \f[C]\-v,\ \-\-verbose\f[]
49+
show commands being run
50+
.RS
51+
.RE
52+
.TP
53+
.B \f[C]\-V,\ \-\-more\-verbose\f[]
54+
show command output
55+
.RS
56+
.RE
57+
.TP
58+
.B \f[C]\-\-debug\f[]
59+
show debug output for this program
60+
.RS
61+
.RE
62+
.TP
63+
.B \f[C]\-h,\ \-\-help\f[]
64+
show this help
65+
.RS
66+
.RE
67+
.SH EXAMPLES
68+
.IP
69+
.nf
70+
\f[C]
71+
$\ quickbench\ \[aq]sleep\ 1\[aq]
72+
Running\ 1\ tests\ 1\ times\ at\ 2016\-10\-16\ 23:06:48.058578\ UTC:
73+
74+
Best\ times:
75+
+\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-+
76+
|\ \ \ \ \ \ \ \ \ ||\ \ \ \ \ \ |
77+
+=========++======+
78+
|\ sleep\ 1\ ||\ 1.01\ |
79+
+\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-+
80+
\f[]
81+
.fi
82+
.IP
83+
.nf
84+
\f[C]
85+
$\ echo\ \[aq]echo\ 3\ *\ 1000000\[aq]\ >\ bench.sh
86+
$\ quickbench\ \-w\ echo,expr\ \-p5\ \-n100\ \-N2
87+
Running\ 1\ tests\ 100\ times\ with\ 2\ executables\ at\ 2016\-10\-16\ 23:57:34.387764\ UTC:
88+
89+
Best\ times\ 1:
90+
+\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+
91+
|\ \ \ \ \ \ \ \ \ \ \ \ \ ||\ \ \ \ echo\ |\ \ \ \ expr\ |
92+
+=============++=========+=========+
93+
|\ 3\ *\ 1000000\ ||\ 0.00112\ |\ 0.00135\ |
94+
+\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+
95+
96+
Best\ times\ 2:
97+
+\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+
98+
|\ \ \ \ \ \ \ \ \ \ \ \ \ ||\ \ \ \ echo\ |\ \ \ \ expr\ |
99+
+=============++=========+=========+
100+
|\ 3\ *\ 1000000\ ||\ 0.00111\ |\ 0.00136\ |
101+
+\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+
102+
\f[]
103+
.fi
104+
.SH FILES
105+
.PP
106+
quickbench looks for tests in \f[C]\&./bench.sh\f[] if no command
107+
arguments or \f[C]\-\-file\f[] option are provided.
108+
.SH LIMITATIONS
109+
.PP
110+
quickbench tests executable files on disk only, not shell builtins or
111+
aliases.
112+
.PP
113+
Options must precede arguments on the command line.
114+
.PP
115+
\f[C]\-V\f[] will become \f[C]\-vv\f[] when implementing that becomes
116+
easier.
117+
.SH BUG REPORTS
118+
.PP
119+
https://github.com/simonmichael/quickbench/issues
120+
.SH SEE ALSO
121+
.PP
122+
Home: https://github.com/simonmichael/quickbench
123+
.PP
124+
bench(1): https://github.com/Gabriel439/bench
125+
.SH COPYRIGHT
126+
.PP
127+
Copyright (C) 2008\-2016 Simon Michael.
128+
Released under GNU GPL v3+
129+
.SH AUTHORS
130+
Simon Michael <[email protected]>.

quickbench.1.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
% quickbench(1) quickbench 1.0
2+
% Simon Michael <[email protected]>
3+
% Oct 2016
4+
5+
# NAME
6+
7+
quickbench - quick & easy benchmarking of command-line programs
8+
9+
# SYNOPSIS
10+
11+
`quickbench [options] [<cmd>...]`
12+
13+
# DESCRIPTION
14+
15+
Runs some test commands, possibly with different executables, once or more
16+
and shows their best execution times in tabular format.
17+
18+
Commands are specified as one or more quote-enclosed arguments,
19+
and/or one per line in CMDSFILE; or read from a default file [./bench.sh].
20+
21+
With -w, commands' first words are replaced with a new executable
22+
(or multiple comma-separated executables, showing times for all).
23+
24+
# OPTIONS
25+
26+
`-f, --file CMDSFILE`
27+
: file containing commands, one per line (- for stdin)
28+
29+
`-w, --with EXE[,...]`
30+
: replace first word of commands with these executables
31+
32+
`-n, --iterations=N`
33+
: run each test this many times [default: 1]
34+
35+
`-N, --cycles=N`
36+
: run the whole suite this many times [default: 1]
37+
38+
`-p, --precision=N`
39+
: show times with this many decimal places [default: 2]
40+
41+
`-v, --verbose`
42+
: show commands being run
43+
44+
`-V, --more-verbose`
45+
: show command output
46+
47+
` --debug`
48+
: show debug output for this program
49+
50+
`-h, --help`
51+
: show this help
52+
53+
# EXAMPLES
54+
55+
```
56+
$ quickbench 'sleep 1'
57+
Running 1 tests 1 times at 2016-10-16 23:06:48.058578 UTC:
58+
59+
Best times:
60+
+---------++------+
61+
| || |
62+
+=========++======+
63+
| sleep 1 || 1.01 |
64+
+---------++------+
65+
```
66+
```
67+
$ echo 'echo 3 * 1000000' > bench.sh
68+
$ quickbench -w echo,expr -p5 -n100 -N2
69+
Running 1 tests 100 times with 2 executables at 2016-10-16 23:57:34.387764 UTC:
70+
71+
Best times 1:
72+
+-------------++---------+---------+
73+
| || echo | expr |
74+
+=============++=========+=========+
75+
| 3 * 1000000 || 0.00112 | 0.00135 |
76+
+-------------++---------+---------+
77+
78+
Best times 2:
79+
+-------------++---------+---------+
80+
| || echo | expr |
81+
+=============++=========+=========+
82+
| 3 * 1000000 || 0.00111 | 0.00136 |
83+
+-------------++---------+---------+
84+
```
85+
86+
# FILES
87+
88+
quickbench looks for tests in `./bench.sh` if no command arguments or
89+
`--file` option are provided.
90+
91+
# LIMITATIONS
92+
93+
quickbench tests executable files on disk only, not shell builtins or aliases.
94+
95+
Options must precede arguments on the command line.
96+
97+
`-V` will become `-vv` when implementing that becomes easier.
98+
99+
# BUG REPORTS
100+
101+
https://github.com/simonmichael/quickbench/issues
102+
103+
# SEE ALSO
104+
105+
Home: https://github.com/simonmichael/quickbench
106+
107+
bench(1): https://github.com/Gabriel439/bench
108+
109+
# COPYRIGHT
110+
111+
Copyright (C) 2008-2016 Simon Michael.
112+
Released under GNU GPL v3+

0 commit comments

Comments
 (0)