Slow screen lock/unlock
Michael J. Lew
michaell at unimelb.edu.au
Wed Mar 16 18:22:28 EST 2005
At 5:41 PM -0500 16/3/05, Jonathan Lynch wrote:
>How long does it take if you comment out the lock screen line?
Well, I thought I had answered that before you asked it, but a typo
got in the way! When I comment out the lock screen line it takes less
than one millisecond.
Unfortunately, simply omitting the lock and unlock screen commands
doesn't get rid of my problem. The reason I ran the test of
lock/unlock speed is that the following test script animates the
points at an unacceptably slow (and somewhat erratic) rate:
on mouseUp
--initialise some convenience variables
put the left of grc 1 into l
put the width of grc 1 into w
put the top of grc 1 into t
put the height of grc 1 into h
repeat
--make randomly placed points
put empty into myPoints
repeat 100
put l + random(w) into x
put t + random(h) into y
put x&","&y & return after mypoints
end repeat
--display them
lock screen
set the points of grc 2 to myPoints
unlock screen
if the mouse is down then exit repeat
end repeat
end mouseUp
Graphic 2 is set to be a polygon with its markers shown (2 by 2
squares) and its line thickness set to zero.
No combination of lock and unlock or no locks makes it any better.
The making of the points and the setting of the points take almost no
time. The slowness is in getting it onto the screen.
...and before someone asks, no, the slowness is not related to
polling the mouse: commenting out that line doesn't change the update
rates.
>
>At 10:08 AM +1100 17/3/05, Michael J. Lew wrote:
>>
>>Subject: Slow screen lock/unlock
>>
>>It takes about 260 milliseconds to lock and unlock the screen (OS X
>>10.3, slowish G4). Here is my test script that takes 2680
>>milliseconds to run:
>>
>>on mouseUp
>> put the milliseconds into startTime
>> repeat 10
>> lock screen
>> unlock screen
>> end repeat
>> put the milliseconds-startTime
>>end mouseUp
>>
>>If I comment out either the lock screen or the unlock screen then the
>>whole thing takes 2 milliseconds and if I comment out the unlock
>>screen line then it takes less than one millisecond.
>>
>>Is it slow on other systems?
>>Is this some Quartz "feature"?
>>Is there something wrong with the way that Rev does screen locking or
>>unlocking?
>>How can I get around slow screen updates for animating lots of points?
--
Michael J. Lew
Senior Lecturer
Department of Pharmacology
The University of Melbourne
Parkville 3010
Victoria
Australia
Phone +613 8344 8304
**
New email address: michaell at unimelb.edu.au
**
More information about the use-livecode
mailing list