3 ms·
The joys of c++
by Cloudef 4y ago
The joys of c++
- FpUser 4y agoYou saying that if rewritten in Rust Chromium will compile much faster?
- Cloudef 4y agoNo, rust is another slow language to compile. But there are faster ones such as C and zig. You can reduce C++ compilation times by following certain strict coding conventions, but it only gets you so far.
- lloeki 4y agoin such large projects linking is also a severe bottleneck, which I hear has been repeatedly tried to be addressed with alternative linkers
- FpUser 4y agoI actually use C++ to write business backends. They're of decent size but nothing monstrous. Compile is almost always nearly instant for me. Full rebuild is still under a minute. Sure I use multithreaded build and am trying not to expose unneeded stuff in headers.
- est31 4y agoYou likely use "C with classes" C++, so C++03 for the most part, not the generics heavy C++ where you put everything into the header because it needs to be generic. This has massive advantages for compile time. Also "decent size" is a term with many definitions. E.g. Chromium has 12 million lines of C++.
- FpUser 4y ago>"You likely use "C with classes" I do write templates but not very often. Also when I do I try to consume those in a single file so that they could be declared there as well without propagating into a header. Not a good idea for writing libraries but works for applications. >"Chromium has 12 million lines of C++." I am far short of that of course.