Revolution is very slow to refresh fields. How can I speed it up?

Sarah Reichelt sarah.reichelt at gmail.com
Tue Apr 4 23:12:44 EDT 2006


> One thing I¹ve hit upon early on that annoys me a little.  Though Revolution
> is far newer, and loads into memory rather than writing to disk, it is still
> way slower at certain things ­ such as refreshing text fields ­ than
> Hypercard ever was.
>
> I wrote the following counting routine (as a speed test to measure the
> difference between writing to a variable and writing to a field).  However,
> what I learned was that ­ on my computer, at any rate ­ Revolution only
> refreshes its text fields slightly more than once a second. When I run the
> same script on Hypercard, the counting field whirs through changes faster
> than a gas pump - with every new number registered on screen.  Revolution
> only shows me about one figure in every twenty five or so ­ despite the fact
> that the routine tells the field to display every consecutive number from 1
> to 300.
>
> Just add this script to a locked text field, and click on it, to see what
> I¹m talking about:
>
> on mouseup
>   -- COUNT TO 300
>   put the ticks into startTime
>   repeat with i = 1 to 300
>     put 1 + line 1 of me into line 1 of me
>   end repeat
>   put the ticks - starttime into stopTime1
>   put stopTime1 into word 1 of line 3 of me
>   put the ticks into startTime
>   put me into testVar
>
>   -- NOW JUST SHOW MULTIPLES OF TEN
>   repeat with i = 1 to 300
>     put 1 + line 2 of testVar into line 2 of testVar
>     if i mod 10 = 0 then put line 2 of testVar into line 2 of me
>   end repeat
>   put line 2 of testVar into line 2 of me
>   put the ticks - startTime into stopTime2
>   put stopTime1 & " : " & stopTime2 into line 3 of me
> end mouseup
>
> Is there any way I can persuade the field to refresh more frequently and
> count like the gas pump?
>

Hi Eric,

The problem is not that Rev is slow, but that it is faster than your
screen refresh rate can handle. If you want to see every number,
you're going to have to slow down the loop and allow your monitor time
to catch up. Try putting "wait 5 ticks" on a new line inside the
repeat loop. Test various lengths of time to wait until you get it to
slow down enough to give you the result you want.

Cheers,
Sarah



More information about the use-livecode mailing list