This is a little experiment and my first Lua project aimed at performance in LuaJIT.
Most of the code is bootstrap, but at the bottom you'll find some tests followed by some benchmarking code.
I'm surprised to find that the benchmarking code runs 4x faster with the tests included than when they're removed. In fact, just removing the print() statement at the end of the tests makes the benchmark run a lot slower. Why is this?
(Unfortunately, I haven't been able to reduce the code sample and still maintain the same behaviour.)