News for hackers. Stuff that matters.
Re:Zapcc: A faster C++ compiler by zvrba on Saturday May 23, 2015 @10:53AM (#9593077)
It seems they're benchmarking on toy programs to create media hype. In my previous job I found out two non-removable bottlenecks in C++ builds: 1) linking (I don't know of any parallel linker), 2) IO (writing of debug information). None of this is relevant in their benchmarks.

In my case, the build result, in _release_ mode, was a DLL file of about 40MB, and corresponding debug info of about 100MB. In _debug_ mode, multiply debug info by a factor of ca 5-10. (Individual PDBs on disk collected together were ~GB, but final PDB was smaller.) Release parallel builds on a 4-core machine, with optimizations and all, (with HT) were noticeably faster because they generated less IO.

Link time of _another_ DLL consisting of many (thousands) separate object files took more time than compilation itself.

There's also another product (I won't name it because it created more problems for me than it solved) which integrates in VS and seamlessly distributes the compilation over machines in the local network. I stopped using it because it often generated corrupt PDB files and messed up IntelliSense in VS.

To summarize, I have two issues with their system (apart from "good enough" solutions for distributed compilation already existing): 1) they say nothing about speeding up the linking stage, and related to that 2) if they mess with linking, I'm not confident that they are reliably handling debug info. Sure, everything works in "toy projects", but.

Re:Zapcc: A faster C++ compiler by imaginenore on Saturday May 23, 2015 @01:47PM (#9593645)
What do you mean by "toy"? In this example GCC takes 3+ minutes:

https://drive.google.com/file/d/0B1WlUivCnXhyRVk0LUl6akxVU2s...

Re:Zapcc: A faster C++ compiler by TwoBit on Saturday May 23, 2015 @11:25AM (#9593167)
We've used a distributed compiler product (incredibuild) with great success.
Re:Zapcc: A faster C++ compiler by yrnkrn on Sunday May 24, 2015 @04:13AM (#9595665)
We (zapcc) do nothing for link acceleration or debug info. The standard system linker is used.

zapcc works well for C++ templates found in all modern C++ libraries.

Re:Zapcc: A faster C++ compiler by krasin on Saturday May 23, 2015 @12:24PM (#9593381)
> 1) linking (I don't know of any parallel linker)

How about ld.gold?

Re:Zapcc: A faster C++ compiler by zvrba on Sunday May 24, 2015 @12:25PM (#9596677)
Oh, I wasn't aware that it was multithreaded. I just found out about it now.

Did you benchmark gold to find out how much MT speeds up linking?

Re:Zapcc: A faster C++ compiler by krasin on Sunday May 24, 2015 @01:45PM (#9596929)
I didn't make precise benchmarking, but when used on a real-world codebases, it speeds up linking about 2x.

One trick to know: never make ld.gold the default system linker, because there would always be awkward kernel modules which will be corrupted at some point, because they would rely on ld.bfd.

Instead, it's recommended to specify -fuse-ld=gold in the command line for your code, see https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html