SRL Archive - News and General

Lape is freaking fast


eska

2012-08-15 01:06:01

So, I was messing with Lape (the future interpreter of simba) a few moments ago and, while I knew Lape was faster, I didn't know just how much faster it was. So I made a small script to test it out. Just though I'd share my findings.

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.

shstiger2009

2012-08-15 01:17:14

That's INCREDIBLE! Wow, really looking forward to this.

Flight

2012-08-15 01:17:26

Hah good comparison. I haven't tried any tests of that sort to give a result but I've watched the time difference in simple color-finding between PascalScript and Lape and it is indeed amazing.

grats

2012-08-15 01:24:46

Well at least lape does correctly what it was designed to do :P

CephaXz

2012-08-15 01:45:39

I had no knowledge about programming at all. So I guess this might be a stupid question.

When this comes out, does the coding of the script same with how we did it now?

Nebula

2012-08-15 01:49:50

Wow that would totally speed up my VineSweeper script I am working on. It currently takes like 1.5 seconds to create a grid and sort the stuff etc. Can't wait :)

eska

2012-08-15 01:50:03

From: CephaXz
I had no knowledge about programming at all. So I guess this might be a stupid question.

When this comes out, does the coding of the script same with how we did it now?


Yes, it's the same. The only difference, is that we will have new stuff we can use (for example, pointers), but you do not need to use those if you don't want to, and so in theory, you could write your script just as you did before and it would work.

Just to give you an idea, I had absolutly nothing to change in the first post's script to make it work in both pascal script and Lape.

CephaXz

2012-08-15 01:51:56

From: eska
Yes, it's the same. The only difference, is that we will have new stuff we can use (for example, pointers), but you do not need to use those if you don't want to, and so in theory, you could write your script just as you did before and it would work.


This is one awesome sexy thing. Looking forward to it. And thanks!

grats

2012-08-15 02:00:12

From: CephaXz
This is one awesome sexy thing. Looking forward to it. And thanks!


http://code.google.com/p/la-pe/

TehNeonFishy

2012-08-15 03:39:03

Nice, when is the switch over?

Flight

2012-08-15 03:50:22

From: TehNeonFishy
Nice, when is the switch over?


Now if you choose. I have a Lape version of LividFarmer up and running. But be warned, not everything is compatible with Lape yet, like SPS and the drawing part of SMART.

J J

2012-08-15 04:34:24

Looking forward to the official Lape release. To celebrate the release I'll work on an advanced/extremely accurate script by calculating loads of things, which is possible now within a lower timeframe with Lape. Not sure what I'm going to make, but Piramid Plunder or something sounds fun. I might look into Vinesweeper but I'm not sure how to recognize the patterns yet :O

fre

2012-08-15 06:39:58

Does this mean it uses more resources of your cpu?
I don't need super fast scripts i want multiple scripts running at the same time.
Like for a main and a pure without having it lag massive.

masterBB

2012-08-15 06:47:05

From: fre
Does this mean it uses more resources of your cpu?
I don't need super fast scripts i want multiple scripts running at the same time.
Like for a main and a pure without having it lag massive.


It will use less resources for the same. You can increase your waits because calculations and such are done faster and more efficient.

fre

2012-08-15 06:49:10

Then it is AWESOME.
Can't wait till we can use it..

Solar

2012-08-15 07:29:17

This is pretty much the first I've heard of LAPE, but from the sounds of it, it'll be good. Looking forward to it.

Flight

2012-08-15 08:41:19

From: fre
Then it is AWESOME.
Can't wait till we can use it..


You can mate, just not everything is compatible with it yet.
Download SRL-Lape
Download Simba 1000 (required)

Kyle Undefined

2012-08-15 10:32:17

Yeah, Lape is pretty awesome :)

Jos3ph

2012-08-15 10:37:47

From: eska
Yes, it's the same. The only difference, is that we will have new stuff we can use (for example, pointers), but you do not need to use those if you don't want to, and so in theory, you could write your script just as you did before and it would work.

Just to give you an idea, I had absolutly nothing to change in the first post's script to make it work in both pascal script and Lape.


What do you think this would do to your monkey script?

eska

2012-08-15 10:46:18

From: Jos3ph
What do you think this would do to your monkey script?


Might help those who have some FPS issues, but not much, because the great majority of the lag is caused by runescape.

It could maybe also allow me to check if a monkey is knocked out before pickpocketing it, but really that's a big 'maybe'.

masterBB

2012-08-15 11:08:39

From: eska
Yes, it's the same. The only difference, is that we will have new stuff we can use (for example, pointers), but you do not need to use those if you don't want to, and so in theory, you could write your script just as you did before and it would work.


Pascalscript:

writeln(1/2); //0

lape:

writeln(1/2); //0.5

eska

2012-08-15 11:12:37

From: masterBB
Pascalscript:

writeln(1/2); //0

lape:

writeln(1/2); //0.5


Sooo it automaticaly convert integers to extended?

Home

2012-08-15 11:18:34

Lape is great and awesome been playing with it for a pretty long time now :)

~Home

nielsie95

2012-08-15 12:06:41

From: masterBB
Pascalscript:

writeln(1/2); //0

lape:

writeln(1/2); //0.5


There are some other minor differences (see this for example), but I'd say most of the scripts should work without any modification. For non-members; it's not weird if you haven't heard of Lape, there's a thread for SRL members which explains all the new futures. This is so that members can get used to Lape and play around with it a bit. Lape still needs a lot of work before a switch can be considered. That's why I tried to keep it sort of "underground" for the public.

But yeah, it should be faster than Pascal Script! :D

litoris

2012-08-15 13:41:44

With that speed, we could pick 4-5 colors from mainscreen objects to find where they are. Looking forward to Lape.

Gala

2012-08-15 16:30:16

As far as I know there is already a lape-branch available, isn't there?

eska

2012-08-15 16:33:12

From: Gala
As far as I know there is already a lape-branch available, isn't there?


Yes but it isn't complete. Can't draw because Tbitmap aren't implemented yet or something. As a result SPS also isn't working… and MSI too.

Vinyl Scratch

2012-08-15 17:30:49

I like how fast it is.
Going to re-code my Runespan script in Lape. Thanks, Eska!

masterBB

2012-08-15 18:31:50

From: eska
Yes but it isn't complete. Can't draw because Tbitmap aren't implemented yet or something. As a result SPS also isn't working… and MSI too.


I am almost done with it. I am writing wrappers for it, this will be the fix for the time being until nielsie comes with somethings better.

shstiger2009

2012-08-15 18:32:20

From: Vinyl Scratch
I like how fast it is.
Going to re-code my Runespan script in Lape. Thanks, Eska!


Did you read everything? You don't have to re-code things, or at least from what I can tell you don't have to.

Kyle Undefined

2012-08-15 18:36:00

From: shstiger2009
Did you read everything? You don't have to re-code things, or at least from what I can tell you don't have to.


But you CAN make improvements with what's written ;)

eska

2012-08-15 18:39:35

From: shstiger2009
Did you read everything? You don't have to re-code things, or at least from what I can tell you don't have to.


Well that depend. As of right now, SRL Lape isn't finished, and so if you use some stuff that isn't implemented yet, you will have to remove it from your script, and find new way to make you script work. For example, if I took my monkey script and tried to convert it to Lape, it would require some important changes, because I use SPS to locate myself (and SPS doesn't work with lape…. yet)

I'd have to find new way to locate where I am.
Also I draw.. can't do that with lape…yet.

Once everything is ready, then yes, you'll probably have little to nothing to change.

Kyle Undefined

2012-08-15 18:42:08

I'm surprised as to how many people are actually excited about it, Lape has been around for awhile with little to no use.

masterBB

2012-08-15 18:45:42

From: eska
Well that depend. As of right now, SRL Lape isn't finished, and so if you use some stuff that isn't implemented yet, you will have to remove it from your script, and find new way to make you script work. For example, if I took my monkey script and tried to convert it to Lape, it would require some important changes, because I use SPS to locate myself (and SPS doesn't work with lape…. yet)

I'd have to find new way to locate where I am.
Also I draw.. can't do that with lape…yet.

Once everything is ready, then yes, you'll probably have little to nothing to change.


Please read what I wrote… I am ALMOST done with it. I read your problems in flight his post so I am adding TMufasaBitmap functions and 'properties'. There is no reason to remove them from your script or find a new way to locate yourself. If you run into problems please just post it at bugs.villavu.com, then some simba/lape developer (mostly wizzup or nielsie) can handle it if required.

eska

2012-08-15 18:49:01

From: Kyle Undefined
I'm surprised as to how many people are actually excited about it, Lape has been around for awhile with little to no use.


Well it was almost hidden in the SRL member only section, and almost no one talked about it.

I'm trying to change that a bit. If more people test it, we find bugs faster, and hopefully it also get fixed faster :^)


From: masterBB
Please read what I wrote… I am ALMOST done with it. I read your problems in flight his post so I am adding TMufasaBitmap functions and 'properties'. There is no reason to remove them from your script or find a new way to locate yourself. If you run into problems please just post it at bugs.villavu.com, then some simba/lape developer (mostly wizzup or nielsie) can handle it if required.


Oh don't worry, I know it's comming. I'm not converting my script yet. But thanks for the heads up and also thank you for the time you put into this project.

Echo_

2012-08-15 19:10:57

Is lape caching the repeated answers or is the computation time really that much faster than pascalscript

masterBB

2012-08-15 19:12:29

From: Echo_
Is lape caching the repeated answers or is the computation time really that much faster than pascalscript


It really is that much faster. Also with not repeating tasks, as far as loops can go non repeating. Everything is faster, apart from wait(x) which takes about the same time.

shstiger2009

2012-08-15 19:21:35

From: masterBB
It really is that much faster. Also with not repeating tasks, as far as loops can go non repeating. Everything is faster, apart from wait(x) which takes about the same time.


I'm glad wait(x) takes the same time, I was about to be blown away if Lape could make time go faster. Oh how useful that would be at certain times… ;)

Wizzup?

2012-08-19 05:11:32

Hey guys, just a quick note.
Simba 991/992 has the latest lape, you don't need the (testing) 1k: http://nala.villavu.com/downloads/simba-prev/c05e13527954d537d9d6a8302c35733ce8d1ad3f/Simba.i386-win32.exe

Secondly, while lape is awesome and faster than pascalscript (and most importantly hopefully stable); it will not, let me stress this, not, make Simba functions faster. Simba will use the same amount of CPU for findcolor, etc.

riwu

2012-08-19 05:42:22

From: shstiger2009
I'm glad wait(x) takes the same time, I was about to be blown away if Lape could make time go faster. Oh how useful that would be at certain times… ;)

Of course it's going to wait the same amount of time as directed by the argument. What Bart meant was that calling the procedure 'wait' (which takes negligible time anyway) will be about the same in lape and pascal.

You can do something like this to test the time taken to call 'wait'.
 
t:=GetSystemTime;
for i:=1 to 100000 do
wait(1);
writeln(GetSystemTime-t);

eska

2012-08-19 09:51:19

^ Nope, I'm pretty sure it was a joke and you just ruined it.

Lol.