The program performs quite well now using Doug Lea's malloc on the Mac
and using Microsoft's default malloc/new under VC++. Recently, I ported
the program to CWPro2/Win32. The performance is abysmal again, due to
the same poor allocator provided in MSL. I am currently trying to get
Doug Lea's malloc working under CWPro2/Win32; if anyone else has
succeeded in this, please let me know.
[Metrowerks, please pay attention here]
Meanwhile, I've discovered the following interesting things. The Mac MSL
Runtime has a file called new.cp (it's in :MacOS
Support:Libraries:Runtime:Common Sources:), which has a #define called
NEWMODE. The default value of this is NEWMODE_FAST, which enables a
custom implementation of operator new. You can also:
#define NEWMODE NEWMODE_MALLOC
which will cause operator new to be implemented via malloc(). This turns
out to be at least twice as fast. Comparing the implementations of
malloc and the "Fast" operator new, I must say that it looks like the
malloc() is a lot more sophisticated and well thought out. The operator
new looks fairly immature (IMHO).
Metrowerks, please consider performing more sophisticated or "real
world" memory analysis and updating your allocators accordingly. Check
out Doug Lea's implementation. Perhaps you could provide a MW-compatible
version of this allocator as an option. Meanwhile, I will continue to
try to get Doug Lea's version working under CWPro/Win32 and will report
on my progress.
Also note that my program performs quite well when built with VC++ and
using Microsoft's allocator (for which there is source code available).
P.S. As this posting goes to press, I finally Doug Lea's allocator
running under CWPro/Win32. It's even faster than Microsoft's allocator!
----- Dan Keith (d...@mcs.com) -----
>Metrowerks, please consider performing more sophisticated or "real
>world" memory analysis and updating your allocators accordingly. Check
>out Doug Lea's implementation. Perhaps you could provide a MW-compatible
>version of this allocator as an option. Meanwhile, I will continue to
>try to get Doug Lea's version working under CWPro/Win32 and will report
>on my progress.
I have forwarded your entire message to our MSL staff, as MSL matures we
are able to optimize and fine tune various functionality, and we are now
doing this. I don't know if allocator functions are being reviewed, but
will ask them to do so.
>P.S. As this posting goes to press, I finally Doug Lea's allocator
>running under CWPro/Win32. It's even faster than Microsoft's allocator!
I'm glad you have it, I'll certainly ask our engineers to view this and
see if it is a practical alternative.
Ron
--
Ron Liechty Metrowerks Corporation MW...@metrowerks.com
Attend a Live NetCast http://www.xmatrix.com/hackerz
Friday, November 14, 7pm est: Metrowerks Mac Programming
with Berardino Baratta, VP Research and Development, Metrowerks