L1VM - primenums benchmark
L1VM - primenums benchmark
I did make a comparison between Node.js and my L1VM in searching primes.
I did not expect this result, because L1VM is using a byte array here.
It is used to make sieve of erathostenes markings in the array.
And my VM is not fast at array accesses because the index is checked to
avoid illegal accesses.
The primes are searched by both programs and then printed out in the shell.
The runtimes are the whole runtime of the programs.
Here are the results:
Node.js:
99999959
99999971
99999989
undefined
real 1m12,610s
user 1m12,729s
sys 0m9,346s
L1VM:
99999959
99999971
99999989
EXIT
real 0m30,719s
user 0m22,396s
sys 0m6,068s
As you can see my L1VM is more than two times faster in this benchmark. It does not use the JIT-compiler: array accesses can’t be speeded up!
Here are the programs: primenum benchmark