I tried a tiny little change to the definition of no to see if it would run a little faster. Please excuse the microoptimisation, but no is used everywhere, making it a little faster is probably worth it. These tests were run with arc3.1 on scheme. with the original (def no (x) (is x nil)) avg min max
arc-code-tokeniser 282.15 269 329
find-top-numbers 174.915 172 220
generate-primes 67.24 65 107
sort-random-numbers 263.365 258 315
string-tokeniser 133.84 129 180
with (def no (x) (if x nil t)) avg min max
arc-code-tokeniser 269.97 258 331
find-top-numbers 168.415 166 218
generate-primes 60.48 58 100
sort-random-numbers 248.405 243 290
string-tokeniser 112.395 108 158
Admittedly, the faster 'no is one entire token less concise, and it's not quite as intuitively readable, so you might not want this (potential 4% depending on your criteria) gain in speed.For comparison, this is how rainbow is performing: avg min max
arc-code-tokeniser 238.45 220 370
find-top-numbers 75.625 69 139
generate-primes 71.41 68 116
sort-random-numbers 103.635 99 239
string-tokeniser 103.62 97 122
I'd like to assemble a few more benchmark cases to build a more thorough suite. Please share your ideas on the kinds of things that should be tested. Or even contribute your favourite frustratingly slow function. The "find top numbers" test is an adaptation of the test in the comment at the bottom of arc.arc.Each test case, for both scheme and java, is run 200 times to warm-up, and then 200 times for the actual measurements. The suite is run in each case from a cold start of the interpreter. If you'd like more details, shout, I'll be happy to be more verbose about it. |