The interpreter has been rewritten from a tree-walk evaluator to a bytecode-compiled stack-based VM, delivering 2β4x speedups across the board.
What's new
- Bytecode compiler and stack-based VM replace the tree-walk interpreter
disassembleCLI subcommand to inspect generated bytecode- The
ackermannbenchmark no longer overflows the stack
Performance
| Benchmark | v0.2.1 | v0.3.0 | Speedup |
|---|---|---|---|
| fibonacci | 318.0 ms | 80.1 ms | 4.0x |
| sieve | 439.4 ms | 125.2 ms | 3.5x |
| closures | 248.5 ms | 78.6 ms | 3.2x |
| perlin | 216.5 ms | 67.5 ms | 3.2x |
| pi_approx | 103.8 ms | 32.3 ms | 3.2x |
| quicksort | 192.0 ms | 75.2 ms | 2.6x |
| map_ops | 74.7 ms | 28.7 ms | 2.6x |
| hof_pipeline | 84.8 ms | 36.7 ms | 2.3x |
| matrix_mul | 133.1 ms | 67.0 ms | 2.0x |