eska
2012-08-15 01:06:01
First, here's the script I used to compare. It basicaly add some bogus numbers together, multiply, then substract, and compare if the 2 numbers are the same (it should be)… and it does this 10 million times:
program new;
{$I SRL/SRL.simba}
var
t, i, a, b, success: Integer;
begin
WriteLn('Starting!');
MarkTime(t);
a:= 1594;
For i:= 0 to 10000000 do
begin
b:= a;
b:= b+(a * 2);
b:= b - (a*2);
if (b = a) then
inc(success);
end;
WriteLn('time = ' + IntToStr(TimeFromMark(t)));
WriteLn('Success = ' + IntToStr(success));
end. So first of all I tested it in Pascal script, our current interpreter. I executed it 3 time, to make sure it was accurate.
Here's the result:
Compiled successfully in 265 ms.
Starting!
time = 39094
Success = 10000001
Successfully executed.So it took on average 39 seconds to execute the script using pascal script. Might seem fast to you, after all, it executed 256 000 loop every second and inside that loop it made some basic calculation.
Now… time to test the script with Lape. Same exact script, only changed the interpreter to Lape. (Script -> Interpreter -> Lape). Again, I executed it 3-5 times to make sure it's accurate.
Here's the result:
Compiled successfully in 1030 ms.
Starting!
time = 843
Success = 10000001
Successfully executed.It took Lape 0.85 second on average to do something that took pascal script 39 seconds. That's 11.7 million loop per seconds.
That's freaking amazing! It's about 45 times faster in this case.
Personnaly I can't wait until lape is fully compatible with SRL. It's going to be a great addition to simba.
Discuss.