Note that only the C "control" example has type information; every other implementation either uses inference or generic arithmetic.
Implementation | Language | Time (ms) | Time rel. C | Arithmetic | Compilation model |
---|---|---|---|---|---|
GCC | C | 20.3 | 1 | mod 2^n | AOT |
SBCL | Common Lisp | 36.4 | 1.79 | bignum | AOT |
SpiderMonkey | JavaScript | 56.0 | 2.75 | float | JIT |
Chez | Scheme | 93.7 | 4.62 | bignum | AOT |
PyPy | Python | 153 | 7.54 | bignum | JIT |
Guile | Scheme | 220 | 10.8 | bignum | JIT |
OpenSmalltalk | Squeak | 236 | 11.6 | bignum | JIT |
MRI --jit |
Ruby | 1224 | 60.3 | bignum | JIT |
MRI | Ruby | 1670 | 82.2 | bignum | Interpreter |
MicroPython | Python | 3840 | 189 | bignum | Interpreter |
CPython | Python | 4409 | 217 | bignum | Interpreter |