uv creator: setting codegen-units=1 made builds 50% faster, cut memory 67%

charliermarsh · x · 2026-10-08

Charlie Marsh, founder of Astral (makers of uv), shared a surprising build optimization: switching to codegen-units = 1 made the uv build 50% faster, cut peak memory by 67%, and reduced binary size by 17%. The result is counterintuitive—increasing the number of codegen units typically improves build times.

Combined with PGO, building the instrumented binary became >90% faster; the final non-instrumented build also got faster, though less dramatically.

Related event: uv author: codegen-units=1 speeds builds 50%, cuts memory 67%(4 posts)→

Original post →

More from coding & agent

coding & agent channel →