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:59:02 EST 2010


On Feb 17, 2010, at 10:02 PM, Jan Schenkel wrote:

> --- On Wed, 2/17/10, Josh Mellicker <josh at dvcreators.net> wrote:
>> You all probably know this, but
>> thought I would share our experience anyway:
>> 
>> We are working on a project with a 1 millisecond callback
>> loop that communicates with an external process in a
>> performance-critical application, and when prototyping,
>> temporarily used some fields on a card to write and read
>> values from during the loop.
>> 
>> Then, while buttoning things up, instead of fields, we
>> switched to reading and writing a custom property.
>> 
>> Suddenly, everything went sluggish - you had to click on a
>> button several times to trigger it, you could barely move
>> stack windows, etc.
>> 
>> It took a while to figure out the culprit, but once we went
>> line by line from our original prototype script, wee found
>> that going back to reading and writing to a field made
>> everything work smoothly again!
>> 
>> Then we tried local, then a global variable... not good...
>> same result as custom properties.
>> 
>> So if you are writing an app where performance is critical,
>> Rev reads and writes to fields super
>> fast!
> 
> If the field you're using to set/get data, is _invisible_ then it makes sense that this would be faster than set/get data using a custom property: built-in properties don't have to traverse the message hierarchy for setProp/getProp handlers, and an invisible field doesn't have to redraw itself.
> Why it would be faster than global/local variable access, is a puzzler - are you using arrays or storing the text in the same 'flat' way as field text?


I never tried arrays, just global, local, custom property and a text field.


> 
> Jan Schenkel
> =====
> Quartam Reports & PDF Library for Revolution
> <http://www.quartam.com>
> 
> =====
> "As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)
> 
> 
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list