Saturday, December 30, 2017

Impact of the compiler in XMR mining

When coming to crypto-mining the selection of the compiler can play a vital role in the performance of the application. In my box (Ubuntu 16.04 LTS - Ryzen 1600), I tried five different gcc compilers to examine the performance. Despite what someone will believe, the latest version does not offer the best performance. Moreover, the oldest compiler, that actual can compile the XMR miner has very bad performance, most likely because when it was developed the Ryzen architecture was not available. The latest version of the 4 series gcc has the best single performance, however, the benefits are non-existent when going to 8 threads. Version 5 has the best results and 6 and 7 have slightly less performance. 

I 'm providing the results of running my customized version of an xmr miner in H/s to get an idea of the performance impact after 60s execution time. I 'm really curious to learn what will happen if I compile with Intel Compiler. The Intel compiler (ICC) gave some minor performance gains in my old (!) i5 4770K CPU, but I doubt that will give any benefit.

Overall, I see a max 2-3% performance gain, except if you are using a really old compiler.


1 Core6 CoresMax (8 Threads)
gcc 4.8.547283326
gcc 4.9.476.3453504
gcc 5.4.175.8450503
gcc 6.3.075.2446492
gcc 7.2.075.2446496