All Blog Posts  |  Next Post  |  Previous Post

Compiling 1 million+ lines of code with Rad Studio 10.4.2


Saturday, February 27, 2021

One of the things that intrigued me about the new Rad Studio 10.4.2 release was the improved compiler performance. Because Delphi is a fast compiler --we all know that-- but hey, it can always be faster. And 10 seconds in every compile end up counting for a lot of time over the days.

So I tried it compiling FlexCel and its test suite. Over a million lines of code, and actual code. This isn't a synthetic benchmark with a single unit and a million lines of "WriteLn('Hello world');". We have lots of generics, a little more than 3000 units, multiple includes, cycles of units that use themselves recursively, and complex dependencies.  It turns out that spreadsheets require a lot of code.

Below you can find a small video, with Rad Studio 10.4.2 on your left and 10.3 on your right. I normally wait a while before adopting a new Delphi version, but given all the time I spend compiling FlexCel, I migrated to 10.4.2 yesterday. This is the type of improvements I want from Embarcadero, and I hope they deliver more.

Adrian Gallero


This blog post has received 3 comments.

1. Sunday, February 28, 2021 at 6:24:56 PM

It would be interesting to see the numbers also for the Win64-compiler and possible also other compilers (if possible).


2. Monday, March 1, 2021 at 1:45:20 AM

Yes, of course.I hadn''t measured those myself, but it is interesting to know. Ok, here are my numbers:

10.4.2 Win64: 36 seconds. (compiling is 26 seconds, linking is 10 seconds)

10.3 Win64: 59 seconds (compiling is 33 seconds, linking is 26 seconds)

So in the time 10.4.2 compiles *and* links, 10.3 only compiles. Win64 is still much slower than win32, but it has improved.

10.4.2 macOS64: 2 minutes (ouch!... but we knew it already) (compiling is 1:40, linking 20 secs)
10.3 macOS64: 5:24 (compiling is 4:50, linking is 34 secs)

Note that those were all debug builds, I didn''t care to measure release. Release might be actually a little faster, because it has to link smaller objects, but probably numbers will be in the same ballpark.

So yes, great work all-around, specially in macOS (and I guess all LLVM compilers). Still much slower than win32, but much more bearable than before. As said in the post, let''s hope they keep improving both compiling time, and performance of compiled code.

Adrian Gallero

3. Tuesday, March 2, 2021 at 7:06:09 AM

Thanks for taking the time and sharing! Much appreciated.

5:24 to 2 minutes is a great step forward indeed! Still, 19 seconds is in another league.

One could hope for the LLVM compilers to turn from single-threaded to multi-threaded in the future. On my computer only approx. 1/32 of all CPU capacity is used when compiling my Delphi applications.

Again, thanks for taking the time!



Add a new comment

You will receive a confirmation mail with a link to validate your comment, please use a valid email address.
All fields are required.

All Blog Posts  |  Next Post  |  Previous Post