Weird speed problem

Lars Brehmer larsbrehmer at mac.com
Mon Aug 20 11:05:57 EDT 2012


I am looking for tips on how to solve a strange problem I am having.

I have two very similar stacks that are behaving very differently speed wise.

In a nutshell;

Both are splashscreen stacks that contain 3 more compressed stacks as custom properties. When the stack (or standalone) launches, if those 3 stacks are not in a folder in preferences, then they are decompressed, opened and save into that preferences folder. Simple and normal. In each case one stack has a few hundred images used as icons for buttons and interface elements in the main stack, one stack contains all kinds of data in the form of custom properties and the third stack is the main stack/program that gets data and icon images from the other two. These are not large stack files.

image stack 1 - 3.4 megs
data stack 1 - 747 kb
main stack 1 - 1.1 megs (about 600 objects)
( and this on actually checks for an update online before it loads)

image stack 2 - 2.5 megs
data stack 2 - 1.3 megs
main stack 2 - 2.1 megs (about 800 very similar objects)

The first one l loads and opens things fast, the second one takes over 10 times as long.

Here's what I have tried so far. I remember a long time ago having a speed issue, and the stack was somehow corrupted.  At the time I made a new stack and copied everything in the old one into it. In that case it solved the problem. This current stack is very old, and I recently started working on it again. So I made a new stack, copied the objects from the old stack and tried again. Snail slow still.

But not in this case! So when I launch the splash screen, I put in a few time measurements to see what is taking so long.

It's not the data stack (9 milliseconds vs. 16 milliseconds)

It's not the images (181 milliseconds vs. 136 milliseconds)

It's the main stack, but I don't know why 750 miliseconds vs. 8800 milliseconds!)

The stacks are very similar - the faster one is based entirely on the older one! What could be wrong here?

RunRev 2.8
iMac, Snow Leopard, 2.4 GHz Core 2 Duo

Anyone have an idea for me to try? There is nothing in these stacks that is particulary complex or cpu intensive. Lots of interface elements that are buttons with icons from the image stack. No heavy code, lots of buttons with short scripts, stack scripts with maybe 1000 lines and a few dozen handlers some of the buttons call up, etc. And once the slow one is loaded, it does everything just as fast as the other one, practically instaneous. The main difference is the slow one uses unicode, but I am not aware of performance issues storing unicode text in custom properties, and when the stack opens, it doesn't access any of the data anyway.

I am out of ideas!

Cheers,

Lars





More information about the use-livecode mailing list