Check if you compiled your code with option Debug. If you compile your code with release option, it will be much faster(about twice faster). Normally the C++ code compiled on Windows is faster than the one made on Linux because optimizer on Windows is better.