Trial-division code runs 2x faster as 32-bit on Windows than 64-bit on Linux

前端 未结 3 1418
深忆病人
深忆病人 2021-01-02 02:08

I have a piece of code that runs 2x faster on windows than on linux. Here are the times I measured:

g++ -Ofast -march=native -m64
    29.1123
g++ -Ofast -mar         


        
3条回答
  •  星月不相逢
    2021-01-02 02:47

    Extracted answer from the edited question:

    It was caused by building 32b binaries on windows as opposed to 64b binaries on linux, here are 64b numbers for windows:

    Visual studio 2013 Debug 64b
        29.1985
    Visual studio 2013 Release 64b
        29.7469
    

提交回复
热议问题