Dear Ars,
I have number-crunching program that processes data generated on our experimental setups. It's programmed in C++, and makes use of the GNU Scientific Library, FFTW, boost::threads, and libtiff. It's portable and compiles on Mac and Windows.
Oddly the performance on OS X and Windows differs strongly on the same hardware. For example, analyzing a particular piece of data takes 23 s on OS X (compiled with g++ 4.2.1) and 1 min 5 s on Windows (compiled with Visual Studio 2008). This is on a dual-booting Macbook Pro. Optimization is on, settings are -O3 on mac and 'fastest code' in Visual Studio. The code is absolutely identical in both cases.
The threefold performance difference annoys me. Since my code is the same on both platforms I'm assuming that the slowdown is in the libraries I'm calling. In particular, for the GSL and FFTW I'm using precompiled binaries as I'm too unfamiliar with Windows to compile them myself. Libtiff is not involved in this particular example, so I can probably eliminate that one (and I have managed to compile that one myself).
I'd love to hear your thoughts on how I can bring Windows up to par. Even if my reasoning is fine then I don't have a clue as to how I could demonstrate which library (or both) is causing the performance slowdown (yes, I do realize that I could write a few test programs to compare the performance of each library separately, but I'm hoping that there is some clever way I haven't discovered yet). Then again, I might be entirely wrong about this.
Edit for improved clarity:
the code in question is pure number crunching, and doesn't include any interface code or anything. It basically starts, crunches, and terminates.
I have number-crunching program that processes data generated on our experimental setups. It's programmed in C++, and makes use of the GNU Scientific Library, FFTW, boost::threads, and libtiff. It's portable and compiles on Mac and Windows.
Oddly the performance on OS X and Windows differs strongly on the same hardware. For example, analyzing a particular piece of data takes 23 s on OS X (compiled with g++ 4.2.1) and 1 min 5 s on Windows (compiled with Visual Studio 2008). This is on a dual-booting Macbook Pro. Optimization is on, settings are -O3 on mac and 'fastest code' in Visual Studio. The code is absolutely identical in both cases.
The threefold performance difference annoys me. Since my code is the same on both platforms I'm assuming that the slowdown is in the libraries I'm calling. In particular, for the GSL and FFTW I'm using precompiled binaries as I'm too unfamiliar with Windows to compile them myself. Libtiff is not involved in this particular example, so I can probably eliminate that one (and I have managed to compile that one myself).
I'd love to hear your thoughts on how I can bring Windows up to par. Even if my reasoning is fine then I don't have a clue as to how I could demonstrate which library (or both) is causing the performance slowdown (yes, I do realize that I could write a few test programs to compare the performance of each library separately, but I'm hoping that there is some clever way I haven't discovered yet). Then again, I might be entirely wrong about this.
Edit for improved clarity:
the code in question is pure number crunching, and doesn't include any interface code or anything. It basically starts, crunches, and terminates.