Speed optimization

Alex Tweedly alex at tweedly.net
Wed Oct 5 11:40:36 EDT 2005


kee nethery wrote:

> My favorite way to speed things up is to do something like
>
> put 0 into x
>
> function newTime oldTime,addedSec
>       if x mod 100 = 0 then
>
>          -- stuff from smart people in previous posts
>
>       end if
>       add 1 to x
> end newTime
>
> Do you really need to change that variable every millisecond or would  
> once every so often be more than adequate? I adjust the factor (in  
> the example 100) so that the display skips a second every so often.

It wasn't a variable he was changing - it's data from a file. Original 
post said:

>Problem is, it seems slow (I need to do this call
>about 150,000 times each file I process). 
>
(sounds like processing a log file or something similar).

So although your advice is good general advice - it doesn't apply in 
this case :-)

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.10/119 - Release Date: 04/10/2005




More information about the Use-livecode mailing list