Sunday, 27 November 2016

Better, stronger, faster ... there is zapcc

Hi folks,


Today is test's day ! After the test of the static code analyser PVS-STUDIO, this time it will be a new C/C++  compiler on the market, zapcc from the young company Ceemple Software which is based on a modified version of LLVM/clang coming with an innovative caching system. It is available on Mac OS X, Linux and Windows. It works with any unix project based with cmake, autotools.

1/ Projects to test

To have some interesting numbers, I will try with some software important enough which needs several minutes of compilation, LMMS, the popular professional music production platform ... The tests will be conducted with unmodified clang provided by the system and zapcc, under Linux Mint, hardware is a i5-5200U CPU and 8GB of RAM.

Let's start with clang























This is the output with make's 5 jobs











Now ... zapcc which I just increased the default memory cache in the zapccs.config file from 1200 to 2000. Apart of this, we can also add which files we do not wish to be cached.



 The compilers executables are respectively zapcc and zapcc++ but we can see their clang "inheritance" through the following output ...






















As you can see, there is a noticeable time decrease.
What if I try with another source code, opencv for instance to see if there is again a visible decrease as opencv takes longer to build than lmms.

Here, the output with clang ....


zapcc ...













As you can see, the delta is again pretty important ! Good job !


2/ Conclusion
 
Zapcc would be valuable for projects like Qt4/5 which usually take several hours to complete the compilation of all the components. In a professional perspective, the value of zappc is perceptible, usually C++ projects mean important sizes, thus by lessening the time spent on the build we can reallocate this time for other ressources ... But due to the caching, you have to keep in mind there is a logical and unavoidable memory usage increase, thus the settings of this part ought to be balanced regarding the target hardware ...

As zapcc is based on clang/LLVM, it could be possibly ported to FreeBSD as this platform gains more and more popularity in the professional world, it might be worthy to consider this possibility.

Labels: , , , ,

View David Carlier's profile on LinkedIn

Tuesday, 17 November 2015

Nearly the end of 2015, what have changed so far ?

Hi folks,

Since couple of months, at home I ve changed quite a few the OSes I use the most. While professionally, I still use mainly FreeBSD and Linux, at home I use more OpenBSD over FreeBSD, and I use also more NetBSD than before and use Linux only when I need to. Might be for many reasons, for the sake of diversification, in the case of OpenBSD I got more used to the "atmosphere" of the tech mailing list and kinda appreciate the innovative approach of NetBSD, hence I got more involved whenever I can, packaging systems included.

Also since a couple of weeks I work on a specific branch of Haproxy for OpenBSD. On Linux, Haproxy takes advantage, in tcp mode, (especially with modern kernel versions) of the popular splice syscall to transfer data between two sockets, which is effective as everything is done in kernel's side. There is a more or less similar solution on OpenBSD, sosplice which is usable in the userland side via setsockopt ; I try to see if it can take advantage of this feature. Indeed, a couple of tests were done with Linux, FreeBSD and OpenBSD, despite Linux was in an older hardware it was noticeably faster. However, this OpenBSD branch is more a "proof of concept" than anything else, probably will never make its way to Haproxy but the performance increased slightly at least.

Labels: , , , ,

View David Carlier's profile on LinkedIn

Saturday, 13 June 2015

Kore.io with DeviceAtlas

Hi folks,

Today while reading my usual tech posts, I found an interesting small project, kore.io, which is a simple but fast web server written in C compatible with Linux, FreeBSD, OpenBSD (but that can work under NetBSD by modifying a little bit the source code ;-)) and Darwin, an event driven one, the workers are per cpu (Linux, FreeBSD and Darwin). which allows to make easily a custom module. Indeed, if you have experience with making apache, nginx modules ... etc ... it's even easier than those ones ;-). So for this purpose, I used a DeviceAtlas API ... Basically it writes a json as a response which contains our usual properties from the user-agent given.

kore loads the small deviceatlas module




Bot detected !
I discussed briefly with the main developer, Joris Vink, quite responsive and nice person I'd say ... The only small downside which he admited himself is (at least for the moment) you cannot define new directives per module but you can easily add new ones no worries ;-) To run small web applications, kore should be sufficient, regarding its low memory usage (with the DeviceAtlas module, more or less 40 MB per worker) and speed (especially under Linux and FreeBSD).

Labels: , , , ,

View David Carlier's profile on LinkedIn

Sunday, 1 February 2015

BSDMag new issue

Hi folks,

The new BSDMag's issue just arrived ! "The journey of a C developer in the FreeBSD world" where I give some tips to Linux developers how to migrate or simply making his work available in this operating system. Enjoy ;-)

Labels: , , , ,

View David Carlier's profile on LinkedIn