L1VM - vs Node.js

I did change the maxloop count of my benchmark programs by factor 10! I ran the benchmark with my L1VM and the Node.js VM node. I did not expect this result, but here it is: Update: I now added the C program result!

Node:

$ time node double-test.js
start...
88000000881

real	0m21,364s
user	0m22,301s
sys	0m0,435s

L1VM with JIT-compiler:

$ time l1vm double-test-optimized-jit -q
88000000881.0000000000

real	0m10,647s
user	0m10,623s
sys	0m0,006s

Here is the C program:

$ time ./double-test
88000000881.0000000000

real	0m5,028s
user	0m5,017s
sys	0m0,002s

I think this result is a statement of it’s own! And IMHO my L1VM is one of the faster VMs! So the L1VM is here now about factor 2 to C.

Update: I did a mixed math benchmark test which does int and double math calculations.

Here are the results:

Node: 36.4 MB RAM usage

$ time node mixed-test.js
start...
104000000521
36800000185

real	0m55,246s
user	0m56,052s
sys	0m1,216s

L1VM no JIT-compiler: 8.5 MB RAM usage

$ time l1vm mixed-test -q
104000000521
36800000185.0000000000

real	0m41,470s
user	0m41,395s
sys	0m0,007s

So my L1VM doesn’t even use a JIT-compiler in this case!

Update: now I set the loop limit three times longer to: 600000000! Here are the insane results:

Node:

$ time node mixed-test.js
start...
312000000521
110400000185

real	2m46,656s
user	2m50,593s
sys	0m4,109s

L1VM no JIT-compiler!!!:

$ time l1vm mixed-test -q
312000000521
110400000185.0000000000

real	2m5,117s
user	2m1,788s
sys	0m2,452s

The benchmark programs can be found here: L1VM-benchmark-05 And the L1VM uses less memory as Node.js!

Here is the L1VM benchmark loop:

    (:loop)
    {count = (count + x)}
    {count = (count + x)}
    {count = (count + y)}
    {count = (count + y)}
    {count = (count + x)}
    {count = (count + x)}
    {count = (count + y)}
    {count = (count + y)}
    {count = (count + x)}
    {count = (count + x)}
    {count = (count + y)}
    {count = (count + y)}
    {count = (count + x)}
    {count = (count + x)}
    {count = (count + y)}
    {count = (count + y)}

    {countd = (countd + xd)}
    {countd = (countd + xd)}
    {countd = (countd + xd)}
    {countd = (countd + xd)}
    {countd = (countd + xd)}
    {countd = (countd + xd)}
    {countd = (countd + xd)}
    {countd = (countd + xd)}
    (no-var-pull-off)
    ((count zero +) count =)
    ((countd zerod +) countd =)

    {loop = (loop + one)}
    (((loop maxloop <=) f =) f if)
        (:loop jmp)
    (endif)

This compiles to the following optimized code:

:loop
loada count, 0, 1
loada x, 0, 2
addi 1, 2, 3
addi 3, 2, 1
loada y, 0, 3
addi 1, 3, 4
addi 4, 3, 1
addi 1, 2, 4
addi 4, 2, 1
addi 1, 3, 4
addi 4, 3, 1
addi 1, 2, 4
addi 4, 2, 1
addi 1, 3, 4
addi 4, 3, 1
addi 1, 2, 4
addi 4, 2, 1
addi 1, 3, 4
addi 4, 3, 1
loadd countd, 0, 1
loadd xd, 0, 3
addd 1, 3, 4
addd 4, 3, 1
addd 1, 3, 4
addd 4, 3, 1
addd 1, 3, 4
addd 4, 3, 1
addd 1, 3, 4
addd 4, 3, 1
addi 1, 0, 4
load count, 0, 5
pullqw 4, 5, 0
addi 1, 2, 1
load countd, 0, 4
pulld 1, 4, 0
loada loop, 0, 6
loada one, 0, 7
addi 6, 7, 8
load loop, 0, 9
pullqw 8, 9, 0
loada loop, 0, 6
loada maxloop, 0, 8
lseqi 6, 8, 9
jmpi 9, :if_0
jmp :endif_0
:if_0
jmp :loop
:endif_0