Compilation benchmark

Inspired by https://vlang.io/compilation_speed, lets try repeat the same on PicoLisp for fun and profit.

Save this code to file gencode.l to create a function with 1 million expressions:
(prinl "(de landau NIL")
(prinl "(let N 0")
(do 500000
   (prinl "(inc 'N)")
   (prinl "(prinl N)") )
(prinl "))")
(bye)


Generating file to test run:
# pil gencode.l > landau.l
# wc -l landau.l
1000003 landau.l
# ls -sh landau.l
9,1M landau.l


Loading the code for the first time check benchmark seconds out of the box and heap size:
# pil +
: (heap)
-> 1
: (bench (load "landau.l"))
0.977 sec
-> landau
: (heap)
-> 54
: (bye)


Increasing heap size to 54MB before code loading helps do performance boost as expected:
# pil +
: (gc 54)
-> 54
: (bench (load "landau.l"))
0.312 sec
-> landau
: (bye)

https://picolisp.com/wiki/?compilationbenchmark

15aug19    tankf33der