note
TheDamian
(Sigh. I just can help myself, can I? Always with the advice... ;-)
<p>Two suggestions for using Benchmark:
<ol>
<li> If you're using long names for each test, pad the names to the same length with extra spaces on the <b>left</b>. Then your results are much easier to read and compare:
<code>
Hash Exists Hit: 4 wallclock secs @ 1204819.28/s (n=1000000)
Hash Defined Hit: 3 wallclock secs @ 2173913.04/s (n=1000000)
Hash Exists Miss: 1 wallclock secs @ 1515151.52/s (n=1000000)
Hash Defined Miss: 3 wallclock secs @ 1492537.31/s (n=1000000)
Hash Assigned Miss Truth: 6 wallclock secs @ 1515151.52/s (n=1000000)
Hash Assigned Hit Equality: 4 wallclock secs @ 1149425.29/s (n=1000000)
Hash Assigned Hit Truth: 5 wallclock secs @ 970873.79/s (n=1000000)
Hash Assigned Miss Equality: 6 wallclock secs @ 877192.98/s (n=1000000)
</code>
<li> Use <tt>cmpthese</tt> instead of <tt>timethese</tt>. That adds a handy comparison matrix at the end of your test results (though this suggestion works much better with shorter names):
<code>
Rate HDH HAHE HAME HEH HAMT HDM HAHT HEM
HDH 1111111/s -- -0% -4% -21% -24% -28% -30% -39%
HAHE 1111111/s 0% -- -4% -21% -24% -28% -30% -39%
HAME 1162791/s 5% 5% -- -17% -21% -24% -27% -36%
HEH 1408451/s 27% 27% 21% -- -4% -8% -11% -23%
HAMT 1470588/s 32% 32% 26% 4% -- -4% -7% -19%
HDM 1538462/s 38% 38% 32% 9% 5% -- -3% -15%
HAHT 1587302/s 43% 43% 37% 13% 8% 3% -- -13%
HEM 1818182/s 64% 64% 56% 29% 24% 18% 15% --
</code>
</ol>
250049
250254