Original Post
I am helping someone with their code, and I am experiencing strange results. The debug version of the code takes much longer to load (I understand this), but it is running 2-3x faster than the optimized version (I don't understand this). We are using IBM's Visual Age 6 compiler (don't ask why). The compiler flag that is causing the great speed improvement is -qheapdebug. I read on IBM's site, and it says this flag replaces all the malloc(), realloc(), and calloc() calls with ones that initialize the memory to known values. This program has no GUI, it strictly does calculations. It uses over 22MB of memory. One thought I had is that these debug calls allocate the chunks of memory closer together so there are less page swaps. Another thought is that when they initialize the memory, more/all of it is preloaded in the cache. Any other ideas? Has anyone seen this kind of behavior? Thanks, Scott