How to speed up MC, Part 3
Yennie at aol.com
Yennie at aol.com
Mon Apr 14 15:30:01 EDT 2003
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
-------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.runrev.com/pipermail/metacard/attachments/20030414/a7a4eeb8/attachment.htm
More information about the metacard
mailing list