On 14 Apr 2006, at 18:17, Giulio <[EMAIL PROTECTED]> wrote:

I've found the difference between my code and yours,

I was using an editfield as an input for the number of cycles

so my code was:

   for ind = 1 to val(inputeditfield.text)
       lista.addrow str(microseconds)
   next

then, to explain myself better in my mail, I've replaced val
(inputeditfield.text) with the number 100000, and that's exactly what
changes the speed in a BIG BIG way

you can try it, take the value of the number of cicles from an edit
field and your performance will dramatically decrease

now my question remains the same:

why reading the value from an editfield ( and casting it to a
number ), althought being a deprecated way to code, should affect the
performance so little on windows and so hard on Mac?

thank you,

       Giulio

tried your original code with these results:
On a MacBook Pro 2GHz Intel Core Duo, 1GB RAM, RB2006r2, OS X v 10.4.6
debug: 3.1s (range 3.0-3.1)
Mach-O build: 2.7s (range 2.6-2.8)
PEF build: 3.1s (range 3.0-3.2)

Same machine but under XP
Windows build: 1.6s (range 1.1-1.9 (!))

On a G4 PowerBook, 800MHz, 512MB RAM, OS X v 10.4.6
Mach-O build: 2.9s (range 2.8-2.9)
PEF build: 2.9s (range 2.8-3.0)

Changed your val("100000") to plain 100000 with little effect:
On a MacBook Pro 2GHz Intel Core Duo, 1GB RAM, RB2006r2
OS X v 10.4.6
debug: 2.7s (range 2.6-2.7)
Mach-O build: 2.5s (range 2.4-2.6)
PEF build: 2.8s (range 2.7-2.9)

Changed your val("100000") to val(inputeditfield.text) with effect as you reported:
On a MacBook Pro 2GHz Intel Core Duo, 1GB RAM, RB2006r2, OS X v 10.4.6
debug: 27.1s (range 27.0-27.1)
Mach-O build: 24.9s (range 24.7-25.1)
PEF build: 27.2s (range 27.0-27.3)

Same machine but under XP
Windows build: 3.5s (range 2.8-4.1 (!))

But optimising to circumvent a call to the editfield on every iteration of the for..next loop (changing the code to for ind = val (inputfield.text) downto 1) results in normal timing
debug build: 2.8s (range 2.6-2.9)

So, yes XP on the same hardware is nearly twice as fast, but then the OS X builds have to go through Rosetta. Also, XP shows the biggest range of times, which worries me for some reason. The old PowerBook is still OK (as all my tests with programs that go through Rosetta on my MBP). Furthermore, changing the val() code for a set number didn't change a lot, but changing it to ref an editField every iteration of the loop did what you reported. However, optimising the code takes that difference away completely.

My 2ยข.
Cheers,
Robert_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to