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

Tuesday, December 26, 2017

Books for software developers professionals

As a software developer you expected to write some code. The difference between a good and mediocre developer is a combination of knowledge and skills. I compiled a list of books that are necessary to all the developers.

At the very early stage of the career, the developer should learn the basics: how to structure his code, how to write small functions, what is desirable and what is not. I can suggest two books for people starting in software development: "Code Complete: A Practical Handbook of Software Construction" from Steve McConnell and "Clean code" of Robert C. Martin. The first one presents the basic rules how to write good code, and the second one explorers in greater depths the best practices for writing good code.

 A also strongly suggest to learn about the design patterns that exists in the
software development. There are two well known books, the Design patterns : elements of reusable object-oriented software by the gang of four (Erich Gamma,‎ Richard Helm,‎ Ralph Johnson,‎ and John Vlissides) and the Head First Design Patterns by Eric Freeman,‎ Elisabeth Freeman,‎ and Kathy Sierra.

After you learned the basics of designing software, you have to move to the architecture side. There are two books that i liked most: the Clean Architecture: A Craftsman's Guide to Software Structure and Design from Robert C. Martin and the Working Effectively with Legacy Code by Michael Feathers. Both are necessary if you are involved in big projects that require both new development and maintenance of the old code. As you are getting older will also suggest to have a look to the The Mythical Man-Month: Essays on Software Engineering by  Frederick P. Brooks Jr. Old book, but provides a good view of the management of large projects.

Finally, we must not forget to train our selfs continuously. What is the best books about this practice out there? I will suggest two of them: the The Clean Coder: A Code of Conduct for Professional Programmers  from  Robert C. Martin and the The Pragmatic Programmer by Andrew Hunt and David Thomas. As a developer you never stop training and improving you self. These two books can provide the directions required for a successful career, at least as developer.