FYI: writing to and reading from fields much faster than locals, globals or custom properties

Josh Mellicker josh at dvcreators.net
Fri Feb 19 20:12:32 CST 2010


On Feb 18, 2010, at 4:29 PM, Kay C Lan wrote:

> On Fri, Feb 19, 2010 at 3:21 AM, Richard Gaskin
> <ambassador at fourthworld.com> wrote:
>> 
>> Maybe that should be "Benchmark Obsessive". :)
>> 
>> True, I was sleeping at 1AM PST, but when I got up this morning I found this
>> intriguing enough to pull out one of my old test stacks.  In fact, while I
>> was at it I took some notes for an article on benchmarking I've been itching
>> to write and posted it to revJournal:
>> 
> Hmmm, maybe 'Benchmark Obsessive Compulsive' ;-)
> 
> Using Richard's stack:
> 
> MBP 17" 2.16 GHz, 2GB RAM
> OS X.6.2, Rev 4.0.0 Build 950
> 
> Number of iterations for read/write access: 5000
> LockScreen = true
> LockMessages = true
> 
> Results:
> Visible field, current card: 	24
> Hidden field, current card: 	22
> Visible field, unopened card: 	13
> Hidden field, unopened card: 	14
> Custom property: 	4
> Global variable: 	2
> Local variable: 	1
> 
> 
> Number of iterations for read/write access: 5000
> LockScreen = false
> LockMessages = false
> 
> Results:
> Visible field, current card: 	2367
> Hidden field, current card: 	2856
> Visible field, unopened card: 	15
> Hidden field, unopened card: 	14
> Custom property: 	37
> Global variable: 	2
> Local variable: 	1
> 
> 
> So very similar results.
> 
> Josh, we are waiting ???



Just to reiterate:

What we found was that when writing and reading a custom property, or a variable, in a 1 ms loop, other stack windows became "sluggish" - very difficult to drag by the header bar, very difficult to click buttons on, rollover states sticking.

When we replaced with writing to and reading a text field on a substack (still 1ms), the other windows responded perfectly normally, you could drag and click just like no callback loop was running.

So I just ASSUMED the field was "faster". Maybe the truth is that custom properties , although faster, somehow interfere with normal mouse-related processes... or maybe what we found was just specific to our app, although I don't see how that could be.

Anyway, I will do some more tests as soon as I can. I just wanted to post, in case someone noticed "sluggishness" in an app with a fast callback loop, my advice is, try fields and see if that fixes it - it did for us!








More information about the use-livecode mailing list