Tech Off Post

Single Post Permalink

View Thread: Why does my C program run faster on Linux than on Windows?
  • User profile image
    Shining Arcanine

    Antitorgo wrote:

    I see that you are linking to GMP in Linux, what math library are you using in Windows? Are you using a port of GMP for Windows? If so, which port? Where did you get it from and how was it compiled?

    Since computing Mersenne Primes with the Lucas Lehmer test is pretty FFT/iFFT intensive the quality of whatever math library you are using is key.

    Seeing as how Prime95 for windows and GLucas for linux/mac both seem to run about the same speed, (granted they both use highly optimized assembly for the FFTs) I highly doubt that Windows is making things slower. (See

    You claim to be comparing apples to apples, but I highly doubt it.

    I am using GMP on windows as well:

    I simply had to apply the patch, follow the instructions in the README, compile lib_gmp_gc in Visual Studio, add it to my solution and put the path to the build.vc8 directory as an additional includes directory in my project's property pages. I also applied all of the optimization flags that I applied to my project to the lib_gmp_gc project.

    By the way, I have been to in the past and I have a thread discussing this on