Two features I don't understand

Richard Gaskin ambassador at fourthworld.com
Fri Oct 31 13:40:00 EDT 2014


Alex Tweedly wrote:
> On 31/10/2014 04:04, Richard Gaskin wrote:
>> What I find most remarkable is the way your benchmark makes the value
>> of this ID caching seem rather trivial.
...
> It is a trivial example - but the speed-up of 50X seems significant.

In relative terms it certainly seems so, but in absolute time just how 
much is being saved?  That is, what is the time required to resolve an 
object ID without caching?

This reminds me of a test I ran yesterday on a different issue, similar 
only in that whether or not it's a valuable thing to do may differ 
depending on whether you're looking at total-time or time-per-iteration:

I was measuring how much overhead is involved in making a call to a 
function relative to performing the same code in-line.

The total time saved was 15.897949 ms, which seems a worthy number until 
we consider that it was running for 100,000 iterations.

In a single iteration it was only saving 0.000159 ms, which for the 
purposes of the test made it clear that the performance "penalty" of 
factoring large handlers is probably not worth the time we spend trying 
to wrap our head around really long complex handlers.

With ID caching we have a nuance that further qualifies its value:  it's 
very specific, caching only ID references but not the more commonly-used 
forms like names or, as often used in loops, ordinal numbers.

That said, I tend to be somewhat obsessive about performance because I 
see every nanosecond saved as a penny in a bank account; over time I can 
save up enough to have some milliseconds free to spend on new features 
like real-time display updates or background processing.

So I'm always grateful for anything that boosts performance in the 
engine, even those that may seem small, since over the long run 
everything adds up.


> Probably worth adding it to the compare-engine-versions benchmark; I'll
> do that once a framework / sample of that happens.

I hope we can get that project going.  It'll be very helpful for many 
purposes.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list