I just finished to run a benchmark on two different machines, a laptop equipped with an Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz and the other is a desktop with an Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz processor. Strangely the laptop outperforms the desktop of a factor grater than 3x. I am using the same compiler version with the same compiling options on the same OS version, i.e, gcc 5.1.0, "-march=native -O3" and Ubuntu 14.04. The code is sequential. Do you have any suggestion?
If you think it's associated with the compiler, this isn't the best forum for questions about gcc. Did you try copying the executable over to check that it is the same? Otherwise, you could compare the diagnostics, for example from -fopt-info . Are you running other applications at the same time on the 8-core box? Did you try disabling HyperThreading?
If your program is file I/O intensive then the O/S settings for file I/O buffering may differ between systems. Copying the same executable, as Tim suggests, will eliminate compiler options differences. Also, if one of the systems is 32-bit and the other 64-bit this can make a difference.