Better HN
topnewbestaskshowjobs
Log inSign up

lingolango

13 karma · joined Sep 11, 2025 (1y ago) · 3 submissions

Submissions

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

>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.