Speed differences between MC and Rev (problem area nearly found)

Wilhelm Sanke sanke at hrz.uni-kassel.de
Fri Oct 13 05:40:29 CDT 2006


On Thu, 12 Oct 2006, Richard Gaskin wrote:
12:52:22 -0700

>
> I'm wondering if it isn't script execution at all, but perhaps memory. 
> I can't think of any way your script could be affected by the mere 
> existence of other scripts, since your main handler is pretty well 
> self-contained (so "send" or other such things which might give RR's 
> scripts some chance to intercede).
>
> I don't believe that the scripts RR's standalone maker insists on 
> adding to one's project are all that large, but perhaps in an 
> intensive environment such as your image processing script requires 
> the difference may be just enough to affect performance.
>
> How much RAM is installed on your machine?
>
> I'm grasping at straws here, but this is such an unexpected result 
> that as far as causes go it may be worth remaining open to 
> possibilities which may even seem unlikely.
>
> --
>  Richard Gaskin


and on Fri, 13 Oct 2006 Chipp Walters wrote:

> Richard,
>
> Your guess about memory just might be a good one.
>
> (snip)
>
> My guess is there is a memory issue at play here, which is always
> difficult to diagnose.
> Wilhelm, your tests are great! Please if you haven't already, test in
> standalones as well. Just create a standalone launcher app, which
> auto-launches the stack in the same folder. One for Rev and one for MC
> and see if the speed differences occur in standalones as well. Perhaps
> you've already done this and I've missed it somewhere?
>
> Good stuff.  -Chipp



Rchard and Chipp, thanks for the responses.

I did test with standalones (see the first line of my previous post: "In 
the meantime I did further tests and built standalones for MC 2.6.5, 
2.73, 2.74 and Rev 2.6.1, 2.73, 2.74. I tested 3 more scripts and also 
tested all scripts with a much larger image of 1600 X 1200."), which 
however could be easily overlooked among the amount of  information 
provided.

I do not think memory could be an issue here. The computer I used for 
testing has 1 GB RAM.

The Revolution IDE surely is more of a memory hog, but the measured 
performance differences between MC and Rev remain about (almost exactly) 
the same even when comparing the standalones built with the same engine.

Following my fresh insight that imagedata handling is the main issue 
here, I changed the positions of lines "put the milliseconds...." to 
*after* getting the imagedata and *before* setting the imagedata again 
at the end of the script:

- old script:

"put the milliseconds into Start
  put the imageData of image 1 into iData
  put 0 into counter
  repeat for each char C in idata
    add 1 to counter
    put chartonum(C)  into tC
    put 2* tC into tC
    if tC > 255 then put 255 -tc into tC
    put numtochar(tC) into char counter of idata
  end repeat
  set the imageData of image 1 to iData
  put the milliseconds - Start into fld "test""

- new script (I am referring to this as "measured inside" in the 
following text)

 "put the imageData of image 1 into iData
  put the milliseconds into Start
  put 0 into counter
  repeat for each char C in idata
    add 1 to counter
    put chartonum(C)  into tC
    put 2* tC into tC
    if tC > 255 then put 255 -tc into tC
    put numtochar(tC) into char counter of idata
  end repeat
  put the milliseconds - Start into fld "test"
  set the imageData of image 1 to iData".

I tested these two scripts in versions 2.6.6 and 2.7.4 of Metacard and 
the corresponding engine versions of Rev 2.6.1 and 2.7.4, both as stacks 
and as standalones. The stacks were always launched from the same folder.
I again used a larger image of 1600 X 1200 which was reset each time 
immediately after each run of a script.

Results (average numbers are given for several measurements in all 
categories):

- MC 2.6.6: Measured inside is 300 milliseconds faster, both in the 
stack and the standalone (9350 vs. 9050)

- Rev 2.6.1 (engine identical to MC 2.6.6)
  Stack: measured inside is 3400 milliseconds faster (13200 vs. 9800)
  Standalone: measured inside is 3500 milliseconds faster (12250 vs. 9050)
 
  There is another difference here between standalone and stack in REV 
2.6.1 indicating an additional interference from the IDE of about 1 second.

- MC 2.7.4
  Stack: Measured inside is 300 milliseconds faster (9400 vs. 9100)
  Standalone: Measured inside is also 300 milliseconds faster (9480 vs. 
9180), but the standalone is slightly slower than the stack ??

- Rev 2.7.4
  Stack: Measured inside is 3130 milliseconds faster (12860 vs. 9730)
  Standalone: Measured inside is is 3200 milliseconds faster (12400 vs. 
9200), and the standalone is somewhat faster than the stack.

As you can see when you compare the above data of MC 2.7.4 and Rev 2.7.4 
there is an additional speed difference between the IDEs even when 
"measured inside": Rev is here an extra 630 milliseconds slower, meaning 
that this difference cannot be accounted for by imagedata handling, but 
must be caused by other interfering scripts in the Rev IDE.

Overall conclusion: Rev is generally 3 seconds slower (33 %) when the 
imagedata handling is included in the measurement. There is also an 
additional interference from the Rev IDE.

Best regards ( see you again next Monday after a longer weekend),

Wilhelm Sanke




More information about the metacard mailing list