Best practice for performance testing

Michael Kann mikekann at
Thu Sep 15 10:53:06 EDT 2011


What I like to do is use a couple of time markers:

put the milliseconds into a_milli
put the  milliseconds into b_milli

Start at the top with both together and you should get zero (to check that it is working).
Keep moving the b_milli marker down until you find the problem.

At the bottom of your code use

put (b_milli - a_milli) && "milliseconds"

In general, if it takes 2 sec to do something it is probably a loop that can be improved or Windows is starting up a program or looking for something.

If you do find the culprit, post the code and I'm sure someone can speed it up for you.


--- On Thu, 9/15/11, Andrew Henshaw <henshaw at> wrote:

From: Andrew Henshaw <henshaw at>
Subject: Re: Best practice for performance testing
To: "How to use LiveCode" <use-livecode at>
Date: Thursday, September 15, 2011, 7:30 AM

Thanks Roger,

Yes,  the Windows spec is pretty similar to my slower macs,  but the performance is significantly different, for example adding a few items at once takes a fraction of a second on the mac,  but about 2 seconds on the windows machine so Im sure there is a big code issue there,  and if I can track that down hopefully I can apply those changes throughout the app and get everything running faster.

Bootcamp and VirtualBox implementations of windows Xp, Vista and 7 are the same,  so its definitely not windows either,  it will be my code somewhere!

I hadnt thought of compiling the app on a Windows PC,  I always compile on Mac so Ill give that a try,  thanks


On 15 Sep 2011, at 12:52, Roger Eller wrote:

> On Thu, Sep 15, 2011 at 7:40 AM, Andrew Henshaw wrote:
>> Hi,
>> Ive got an application that quite happily runs along at an acceptable speed
>> on my Macs,  but on Windows systems it seems to struggle.
>> Im trying to pin down the parts of the code that I need to look at so I can
>> work out what is happening.  My best guess would be the interaction with the
>> sqllite database,  but thats just a guess!
>> Does anyone have any suggestions as to the best way to do this.
>> Im thinking of writing a command I can call to simple log some text and the
>> milliseconds to a file,  so I can insert calls to the command through the
>> various code and track exactly what time each are called,  but something in
>> the back of my head says this might not be the best solution as the file
>> write will also take time.
>> Is there a best practice way to do something like this,  im afraid I
>> started life programming on a Sinclair ZX80 and my skills have probably not
>> progressed much!!
>> Andy
> Do the Windows machines have equal hardware specs to the Macs where it is
> performing well?  Can you run Windows in Bootcamp on the same Mac for
> testing?  Did you build the Win application on Windows?  That can have an
> effect on execution speed.
> ˜Roger
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

use-livecode mailing list
use-livecode at
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the Use-livecode mailing list