writing to and reading from fields much faster than locals, globals or custom properties
jim at visitrieve.com
Thu Feb 18 06:38:47 CST 2010
Josh Mellicker wrote:
> You all probably know this, but thought I would share our experience
> 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
What "we know" is actually quite the opposite. The speed order should be
local/global/constant - custom property - field, with a very miniscule
difference between globals and custom properties (custom props have to be
"copied" in memory first) and a very significant difference between any of
these and fields, even with *lock screen*.
Would you be so kind as to isolate and confirm your results and let us know
which Rev and on what platform/OS and provide us with a code example or,
better yet, a test stack we can download that demonstrates what you are
experiencing, so we can all test your code on different platforms and
versions of Rev for ourselves?
If you are running a recent release of Rev and what you are saying proves to
be so for that release, then you have discovered a major bug. So, it's very
Aloha from Hawaii,
More information about the use-livecode