3 ms·
On a single core processor, obviously not, but massive C++ codebase are compiled with multicore CPU, and often distributed. The advantage of the header inclusio
by subb 5y ago
On a single core processor, obviously not, but massive C++ codebase are compiled with multicore CPU, and often distributed. The advantage of the header inclusion model is you get an bunch of independent compilation units, and so it's straight forward to parallelize.
A common way to speed things up even more is to merge some cpp file together, so each compiler thread is active for longer and common headers are compiled once.
With the new module feature of C++20, compilation is transformed into a DAG, and it is still unclear if it's really faster than just throwing a lot of cores at the problem.
- unnouinceput 5y agoYou show me that IDE for C++ who is using those multicore CPU's for compilation who's faster than Delphi, for same number of lines and/or external dependencies. Btw, Delphi is still using 32 bits for its IDE and a single core and still blows out of the water anything else in terms of millions of lines of code compilation time.
- jcelerier 5y agoI wondered if Delphi supported LTO (as that's one of the main compile-time-eaters) and the only examples I could find of sentences containing both "Delphi" and "LTO" referred to Delphi support for TAPE DRIVES (https://wikipedia.org/wiki/Linear_Tape-Open https://wikipedia.org/wiki/Linear_Tape-Open). Of course prehistoric tech is faster, running a 1995 game on a i7 would also be fast. What matters is, is Delphi able to match C++ in run-time benchmarks ? Also, here's a video of my edit-compile-run cycle ; cloc on that project gives me 506963 loc without counting dependencies. The software uses boost and fairly modern C++ with no particular feature restriction and templates going wild. It's not instant, but still, 2 seconds is somewhat tolerable (and definitely faster than various web stuff I've been involved with) https://streamable.com/az397y https://streamable.com/az397y
- unnouinceput 5y agoWhat I see there is a compilation of current module that you modify. Do a full project rebuild, then show. Here is the link to Delphi, official one, for a comparison between 2 of the previous version (10.4.1 vs 10.4.2): https://www.youtube.com/watch?v=lBSpv94FDE4 https://www.youtube.com/watch?v=lBSpv94FDE4 And then here is a claim that latest one (Delphi 11 Alexandria) is even faster: http://www.danieleteti.it/post/delphi-11-alexandria-compiler-speed-comparison/ http://www.danieleteti.it/post/delphi-11-alexandria-compiler... I don't have Delphi 11, yet, so I can't verify their claim, but 10.4.2, which I have, is noticeable faster than previous versions I have scattered around in my virtual machines.
- jcelerier 5y ago> Do a full project rebuild why would I ? I never have to do that during my dev cycle, that's not something really worth optimizing for. The whole build is ~4/5 minutes on that machine.
- unnouinceput 5y agoThen there you have it. I have a project, written by me around 150k lines. Has DevExpress components, ReportBuilder components and the whole build is around 2M lines in total in around 30k files, with full dependencies (I have sources for all). Takes 25 seconds, and is inside a virtual machine - as my philosophy is "each project inside their own VM". Also the link I gave you for video, that's a full rebuild. The guy does a cleanup first, getting rid of existing builded components/modules and then does a full rebuild.