Revolution speed sucks?
Richard Gaskin
ambassador at fourthworld.com
Tue Aug 5 23:09:01 EDT 2003
Geoff Canyon wrote:
> If the script I'm looking at is the one you're talking about, it's
> parsing through the contents of the field one bit at a time, and
> setting the style of text (text color) bit by bit.
>
> For speed, you need to get the contents of the field, work on that
> (paying special attention to repeat for each) and then set the HTMLtext
> of the field. This will be much faster.
>
> On Tuesday, August 5, 2003, at 06:32 PM, yoy wrote:
>
>> I ran my stack "OmniLotto" and generated 5000 random powerball games.
>> Then
>> it ran. It .took over 30 minutes!!!
>>
>> I saved the 5000 gamelist and ran it through my PERLotto perl script
>> out to
>> "results.txt".
>>
>> It took only 1 second!!!!!!!
Even as-is, the Start button there executed its script in just a few seconds
on my ol' 500MHz G4. What sort of system was it tested on, and what else
was running at the time?
A Rev program can do a lot of work in 30 minutes, and even with the
inefficiencies in the current script it's just not asking much of Rev that
it shouldn't be able to do in a small fraction of the time reported.
General tips for optimization:
- Touch data in fields as little as possible; put the data into a variable
and work on it there, tucking it back into the field when done.
- Use the "repeat for each" construct over "repeat with" everywhere
possible.
- For lengthy operations that affect the drawing on any controls, use "lock
screen" before the operation and "unlock screen" when it's done.
- Unless a lengthy operation also needs to process system messages, use
"lock messages" before the operation and "unlock messages" when it's done.
--
Richard Gaskin
Fourth World Media Corporation
Developer of WebMerge: Publish any database on any Web site
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the use-livecode
mailing list