HNHacker News
TopNewBestAskShowJobs

lingolango

13 karma · joined September 11, 2025

submissionscomments
lingolango··on C++20 Modules: Practical Insights, Status and TODOs
Tried building sqlite amalgamation just now.

Input: single .c file 8.5MB.

Output: 1.8MB object file.

Debug build took 1.5s.

Release build (O2) took about 6s.

That is about 3 orders of magntiude slower than what this machine is capable of in terms of IO from disk.

lingolango··on C++20 Modules: Practical Insights, Status and TODOs
Linux is ~1.5GB of source text and the output is typically a binary less than 100MB. That should take a few hundred milliseconds to read in from an SSD or be basically instant from RAM cache, and then a few hundred ms to write out the binary.

So why does it take minutes to compile?

Compilation is entirely compute bound, the inputs and outputs are minuscule data sizes, in the order of megabytes for typical projects - maybe gigabytes for multi million line projects, but that is still only a second or two from an SSD.

lingolango··on C++20 Modules: Practical Insights, Status and TODOs
>since the bottleneck in large codebases is not a compute, e.g. headers preprocessing, but it's a memory bandwidth.

SSD bandwidth: 4-10GB/s RAM bandwidth: 5-10x that, say 40GB/s.

If compute was not a bottleneck, the entire linux kernel should compile in less than 1 second.