How to speed up MC, Part 3
Wil Dijkstra
W.Dijkstra at fsw.vu.nl
Tue Apr 15 06:42:01 EDT 2003
Hi Brian,
You're quite probably right. Actually I generated a random integer within each repeat loop and added 1 to it, then subtracting the time for the overhead, including the repeat itself. I use CodeWarrior. It allows for a number of different optimizations. Didn't try them out for this test, so results may quite different, depending on the kind of optimization, but undoubtedly indeed, C or Pascal will be many times faster. Didn't want to go into detail on this stuff, as I suspect most MC users are completely unfamiliar with it.
By the way, are you the author of the famous "Yennie's externals"?
Wil Dijkstra
> ----------
> From: metacard at lists.runrev.com
> Reply To: metacard at lists.runrev.com
> Sent: Monday, April 14, 2003 20:26
> To: metacard at lists.runrev.com
> Subject: Re: How to speed up MC, Part 3
>
> More good stuff (and thanks for being a kindred soul to hash these things out
> as a resource for the list)!
>
> One thing that may bear some clarification, depending on how you did you
> benchmarks:
>
> > Pascal: x := x+1 --> 1
> > C++: x = x+1 --> 1
> > MetaCard: add 1 to x --> 80
> > MetaCard: put x + 1 into x --> 130
> > HyperCard: add 1 to x --> 2800
> > HyperCard: put x + 1 into x --> 3600
> > Empty extension: --> 3500
> >
> Part of what may be going on here, depending on your code, is not just the
> relative speed of C++ / MetaCard.
>
> Any good C++ compiler does a lot of optimization. So if you simply wrote a
> repeat loop which incremented a variable inside, say 10,000 times, the
> compiler may simply compile it as the equivalent of "add 10000 to x" rather
> than 10,000 separate instructions. If you actually force the compiler to
> access the value of the variable in each iteration, it may affect the
> comparisons by disallowing that optimization.
>
> With that said, I'm nitpicking: you did say rough and the relative order is
> certainly right. Just call me nitpicker...
>
>
>
>
>
> ------------------------------
> Brian Yennie
> Chief Technology Officer
> QLD Learning, LLC
> www.QLDLearning.com
>
> PH: (904)-997-0212
> EMAIL: Yennie at aol.com
> -------------------------------
>
>
>
More information about the metacard
mailing list