Blog 2019/11/2
<- previous | index | next ->
Let's use a trivial (recursive) Fibonacci benchmark to compare the performance of a few Scheme interpreters.
(define (fib n) (if (< n 2) n (+ (fib (- n 1)) (fib (- n 2)))))
(display (fib $n))
(newline)
Specifically, I was interested in looking at start-up time and overall throughput (actually, function-call overhead).
- 👍 Startup time: Elk, Chicken
- 👍 Throughput: Chez, Racket
Overall results:
A close-up of the "knee" of the curve:
If we focus on small values of n
, we can compare start-up time. Here, non-JIT'ed interpreters will perform well.
If we focus on large values of n
, we get a sense of the overall throughput (actually, the function-call overhead) of the interpreters. Here, the JIT'ed interpreters will perform well.
@cellularmitosis, Hi Jason,
I just tested (fib 44) with current chez, janet, fennel [*] and jitterlisp:
For you as a Janet contributor, probably the most interesting project will be jitter [1]. Jitter is a toolkit designed for building fast VMs without the "rocket science" needed for advanced compilers like LuaJIT or Chez. Jitterlisp is one of three demo VMs included in the source. I know about this "stealth" project and its genius author - Luca Saiu, only because GNU Poke [2] is implemented as Jittery VM. It would be wonderful, if turns out to be possible Janet VM to receive a significant speed boost only with refactoring its VM C code as a Jittery VM too :-)
[*] janet like dialect, compiles to Lua, initially also started by @bakpakin.
[1] http://git.ageinghacker.net/jitter/tree/example-vms/jitterlisp/examples/fibo.c
[2] https://git.savannah.gnu.org/cgit/poke.git/tree/libpoke/pvm.jitter