Kevan Hashemi wrote:
Dear GPC Users,
The GPC manual says I can turn off range checking with {$R-} or with the command-line option --no-range-checking. I tried both, but the compiler gives me an error: unrecognised directive. I'm using GPC for MacOSX compiled with GCC 3.3.
The version on my website is based on gpc-20030507 which doesn't have range-checking. Updated compiler binaries will be available soon there soon. The latest gpc alpha partially implements range-checking.
Can I turn off range checking?
I translated a few thousand lines of Code Warrior Pascal into GPC Pascal. As I did so, I took the opportunity to make use of GPC's wonderful dynamic schemata types, so I removed all my ugly pointer arithmatic, which I had previously used to access dynamically allocated blocks of memory.
My translated code runs at half the speed of my original code. I don't think it is the dynamic schemata, but I thought I would turn off the range checking just to see.
I can hardly believe it's the generated code, but nothing is impossible ... If you send me the source code, I will have a look at it (but I have very limited time available this month).
What other default compiler options might slow down the code? Should I turn off debugging information?
Try -O2 or -O3 for code optimization. Putting off debugging information only affects the size, not the speed. Be aware that, in general, bad field alignments may greatly decrease the speed of the PowerPC chip (e.g. doubles aligned on 4-byte boundaries rather than on 8-byte boundaries).
Yours, Kevan Hashemi
Regards,
Adriaan van Os