I recently started my own Lua project combining encoders and decoders for different Base-N encodings and only after pushing it to luarocks.org found out that such a project already exists, so I decided to benchmark them both to see if my new code is at least faster. Lo and behold, yes.
Lua | Based | BaseXX | ratio |
---|---|---|---|
Lua | 0.010629 | 0.078772 | x0.13 |
JIT (on) | 0.002530 | 0.024218 | x0.1 |
JIT (off) | 0.005205 | 0.034397 | x0.15 |
Lua | Based | BaseXX | ratio |
---|---|---|---|
Lua | 0.009658 | 0.080785 | x0.12 |
JIT (on) | 0.002203 | 0.037336 | x0.06 |
JIT (off) | 0.004537 | 0.037538 | x0.12 |
Note: Tests for incorrect decoding have been removed, but the corresponding code has been kept, as it has no real effect on the output.