This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-08-02 09:07:25

estorken
Scratcher
Registered: 2010-04-01
Posts: 41

is it faster to call a variable or to perform an equation?

i know it probably depends on the length of the equation, but it might be definitively faster one way. if not then where (approximately) is the cross-over point. they might be almost exactly the same idk.

this is important if you have an equation you can either save a variable to the result and use that or run the equation over again multiple times.

i think a list would probably be slower (they seem inexplicably slow. it's funny, the list to variable speed ratio is SOOO low), but i'm not sure about a variable.

so, yah thanks.


http://i56.tinypic.com/esqpma.gif

Offline

 

#2 2011-08-02 12:07:36

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: is it faster to call a variable or to perform an equation?

estorken wrote:

i know it probably depends on the length of the equation, but it might be definitively faster one way. if not then where (approximately) is the cross-over point. they might be almost exactly the same idk.

this is important if you have an equation you can either save a variable to the result and use that or run the equation over again multiple times.

i think a list would probably be slower (they seem inexplicably slow. it's funny, the list to variable speed ratio is SOOO low), but i'm not sure about a variable.

so, yah thanks.

I would say calling it from the variable is faster but to be honest it makes very little difference.


http://i.imgur.com/zeIZW.png

Offline

 

#3 2011-08-02 16:51:02

estorken
Scratcher
Registered: 2010-04-01
Posts: 41

Re: is it faster to call a variable or to perform an equation?

OK, thank you


http://i56.tinypic.com/esqpma.gif

Offline

 

Board footer