properties vs local variable
dunbarx at aol.com
dunbarx at aol.com
Mon Mar 10 11:33:22 EDT 2014
I tried a simple test. I placed 100,000 lines of text into a custom property and into a variable. I timed how long it took to directly access a single line, 10,000 times. It took 2 ticks for the custom property, and almost no time at all for the variable.
So the custom property is slower, but still pretty fast. What really matters is other stuff. For example, in the same pair of setups, if I asked for "any line" of either the prop or the variable, the process took about 30 seconds. That function call took its sweet time. So the lesson here is to watch carefully what is a first order issue, and what is a fourth order issue.
Craig Newman
-----Original Message-----
From: Mark Schonewille <m.schonewille at economy-x-talk.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Mon, Mar 10, 2014 11:18 am
Subject: Re: properties vs local variable
Hi Terry,
The split command itself doesn't slow it down, because that happens
outside the repeat loop. However, arrays appear not to be the fastest
way to access data and apparently in this case the removal of the
counter was not enough to compensate for the addition of the arrays.
I see no thText in your original script. Perhaps you need to post more
code, including the part that retrieves the data from the database all
the way up to and including the part where it displays the data.
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553
Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other
colour spaces. http://www.color-converter.com
Buy my new book "Programming LiveCode for the Real Beginner"
http://qery.us/3fi
LiveCode on Facebook:
https://www.facebook.com/groups/runrev/
On 3/10/2014 16:07, Terence Heaford wrote:
> Hi Mark,
>
> Have tried your adjustments to my script and it was a little slower than the
original.
>
> Could that be because of the split command?
>
> I read the data in from an SQLite file in the return/tab delimited format.
>
> put revDataFromQuery(tab, return, the uDB of this stack, tSQL) into tData
>
> then I pass the data to the group
>
> set thText of group “myTable" of cd “myCard" of stack “myStack" to tData
>
>
> I wonder if I split the data into an array and pass it directly to the group
as an array if that would be quicker because there would be no need for the
split to occur in the displayData routine?
>
>
> All the best
>
> Terry
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list