properties vs local variable
dunbarx at aol.com
dunbarx at aol.com
Mon Mar 10 13:21:25 EDT 2014
Alex. I had tried lines 3, 3000 and 7500.
I did indeed only report the first value, likely because I wanted to slant my point about different types of processes overwhelming others in my favor. It is a character flaw.
But I got very similar results with the other two:
For line 3: 0 and 2 ticks
For line 3000: 57 and 59 ticks
For line 7500: 135 and 137 ticks
The same offset, if you will, as the 0 and 2 that I got with line 3.
Not sure why yours are so different. I had, with my 100,000 line list in "the testProp" of the card:
on mouseUp --test variable
get the ticks
put the testProp of this cd into temp
repeat 10000
put line 7500 of temp into xyz
--put any line of temp into xyz --that other "process"
end repeat
answer the ticks - it
end mouseUp
on mouseUp --test custom Prop
get the ticks
repeat 10000
put line 7500 of the testProp of this cd into temp
--put any line of the testprop of this cd into temp --that other "process"
end repeat
answer the ticks - it
end mouseUp
Craig
-----Original Message-----
From: Alex Tweedly <alex at tweedly.net>
To: use-livecode <use-livecode at lists.runrev.com>
Sent: Mon, Mar 10, 2014 12:45 pm
Subject: Re: properties vs local variable
On 10/03/2014 15:33, dunbarx at aol.com wrote:
> 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.
The question is - *which* "single line" did you test with ?
with the same circumstances, accessing
line 1 takes 3 msec
line 5000 takes 349 msec
>
> 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.
It's not just the "any" that takes the time, it's the fact that on
average it will be equivalent to the middle line.
-- Alex.
_______________________________________________
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