Two features I don't understand
Alex Tweedly
alex at tweedly.net
Fri Oct 31 12:49:55 EDT 2014
On 31/10/2014 04:04, Richard Gaskin wrote:
> Alex Tweedly wrote:
>> Hmmmm - I said this once before :-) :-)
>
> My apologies for the inconvenience. I'd either missed it before or
> completely forgot about it, but the latter seems unlikely given how
> remarkable the post was:
>
Oh Richard - I even threw in 2 smiley faces so you would *know* I was
teasing you :-)
>>> in 5.5.3
>>> name takes 830 ms while id takes only 250 ms
>>>
>>> but in 6.0 (i.e. with id caching)
>>> name takes 830 ms while id takes 5 ms
>>>
>>> -- Alex.
>>>
>>>
>
> What I find most remarkable is the way your benchmark makes the value
> of this ID caching seem rather trivial.
>
> I trust this was a one-liner, as I can't imagine them spending much
> time optimizing something so very specialized and which takes so
> little execution time per iteration.
>
> I wonder what prompted this one...perhaps something specific to the
> coding style of the person who wrote the Project Browser?
>
It is a trivial example - but the speed-up of 50X seems significant.
It's not just *the* most recent ID that is cached (at least according to
a simple-minded test I did - see the original thread for details). It
does appear that it speeds up access to a number of cached IDs. So if
you had a lot of controls (Datagrid ??) and were doing something to them
multiple times (scrolling?, fading in/out, ...) then maybe it would be
noticeable, if not actually significant.
Anyway - this is one way to test it - whether or not you find it useful.
Probably worth adding it to the compare-engine-versions benchmark; I'll
do that once a framework / sample of that happens.
--Alex.
More information about the use-livecode
mailing list