Speeding up this handler

Tereza Snyder tereza at attainmentcompany.com
Mon Apr 14 16:47:01 EDT 2003


on 04.11.03 8:47 PM, Shari wrote:

> I'm trying to shave the first handler down to about 150 milliseconds.
> Handler 2 was just a test to see how quickly Metacard could set the
> filename of 99 images.  I've tried several variations, but so far the
> 620 is the fastest, but it isn't fast enough.
> 
>

Hi Shari,

I was able to speed up loading the images so that it took only about 20 msec
longer than the dummy handler by calculating the offset into the array
myself, rather that relying on mc, and by using the object number of images
rather than looking up object names.

Combined with optimizations suggested by others you should be able to get
decent performance!

Tereza


on Test pRow, pCol
  GLOBAL gFileNamesA
  lock screen
  put 1 into N
  put (pRow-1) * 43 + pCol into tS
  put tS + (43 * 8) into tE
  repeat with iR = tS to tE step 43
    repeat with iC = 0 to 10
      set the filename of img N of grp "imagegrid" to gFileNamesA[iR + iC]
      add 1 to N
    end repeat
  end repeat
  unlock screen
end test


 

+ Tereza Snyder 
+ Senior Software Developer
+ Attainment Company, Inc.
+ <www.attainmentcompany.com>
+ 800.327.4269




More information about the metacard mailing list