With GCC 4.3.3 on Linux, "-O0" is slow, "-O1" and above give 0 seconds.
With GCC 4.3.3 on Linux, "-O0" is slow, "-O1" and above give 0 seconds.
I finally got Kdevelop working and rewrote the program in the ide and turned on optimization via kdevlops menu. The C++ version now runs as fast as the java version (roughly, I didn't put the timer statements in)
I'm not sure why the optimization switch on the command line didn't seem to do anything, but thanks for all the help and comments.