Hi Alex,

>> >               java wl    ErsatzLisp   Pil32    Pil64
>> >              +---------------------------------------
>> >    (fibo 22) |   25        0.19       0.015    0.016
>> >    (fibo 23) |   45        0.25       0.026    0.024
>> >    (fibo 24) |   69        0.36       0.041    0.039
>> >    (fibo 25) |  122        0.52       0.060    0.063

I'm surprised that pil32 performs the same as pil64 even though it
doesn't have short numbers.

While we are discussing this microbenchmark, I was curious how does
picolisp compare to Lua:

|         | pil64-3.0.4 | lua-5.1 | luajit-2.0.0 | c -O2 |
|---------+-------------+---------+--------------+-------|
| fibo 25 |        0.02 |    0.02 |         0.01 |       |
| fibo 30 |        0.16 |    0.18 |         0.08 |       |
| fibo 40 |       19.54 |   22.32 |         8.78 |  1.30 |

What about implementing JIT for picolisp? ;-D

I was also surprised that changing:

(de fibo (N)
   (if (> 2 N)
      1
      (+ (fibo (dec N)) (fibo (- N 2))) ) )

to

(de fibo (N)
   (if (< N 3)
      N
      (+ (fibo (dec N)) (fibo (- N 2))) ) )

had such significant effect. The version with (> 2 N) is much slower:

|         | pil64-3.0.4 |
|---------+-------------|
| fibo 25 |        0.03 |
| fibo 30 |        0.27 |
| fibo 40 |       31.08 |

The experiment is at:

   $ git clone http://logand.com/git/bench-fibo.git

Simply

   $ make
   $ make bench

to see the results.

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to