Speeding up this handler

Yennie at aol.com Yennie at aol.com
Fri Apr 11 23:53:01 EDT 2003


If you can afford to change the format of cMap, you can change:

set the filename of image bMap[z] to line y of cMap[x]

to

set the filename of image bMap[z] to cMap[x,y]

i.e. instead of storing multi-line items in the array, use a two-dimensional 
array.

This will save you *some* line-by-line lookups. By my count, the worst case 
(where the small square starts at row 33 and continues to row 43, you get 
this many line scans:

(33*11) + (34*11) + (35*11) ... = (33+34+..43)*11 = 4598 lines scanned.

Frankly, 5000 lines goes pretty quick in Metacard, but it may shave a few 
milliseconds in some cases.

One other possibility, instead of always using the filename property: create 
hidden image objects for each of the 800+ images. Thus they load once when 
the card opens. Now... instead of setting the fileName of other objects, set 
the imageData property:

set the imageData of image bMap[z] to the imageData of image cMap[x,y]

Of course, this has it's own drawbacks, not the least of which is 800+ extra 
objects.

HTH

------------------------------
Brian Yennie
Chief Technology Officer
QLD Learning, LLC
www.QLDLearning.com

PH: (904)-997-0212
EMAIL: Yennie at aol.com
-------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.runrev.com/pipermail/metacard/attachments/20030411/fb254c30/attachment.htm


More information about the metacard mailing list