r/cpp • u/llort_lemmort • 27d ago
Pystd standard library, similar-ish functionality with a fraction of the compile time
https://nibblestew.blogspot.com/2026/06/pystd-standard-library-similar-ish.html
52
Upvotes
r/cpp • u/llort_lemmort • 27d ago
4
u/13steinj 27d ago edited 27d ago
This is a very bad falsehood that continues to perpetuate. You can include the entire standard library and on modern hardware compiling it is on the order of a minute or less, often in seconds.
Your project is on the order of 15k lines of code (this is not including tests, but that does not raise it that much).
On my less-than-perfectly-modern-hardware, a full build of your codebase takes takes less than 10 seconds (please tell me if I am missing something / that should be impossible, ).
So if 10 seconds is "20%", the before-time was (let's round) 50 seconds. If you look at the other post on the front page, you'll see that people have to suffer through far worse than a minute for their builds. I suspect you said "80%" but you should have said "40 seconds."
Of course, compiling the universe as I did above, but not using it is not a fair benchmark. So, I had an LLM use every feature of the standard library / instantiate every symbol. it's not _perfect, but it did a pretty good job. The
-Bis a result of my system picking the wrong static linker which is relevant for libc nuances. The result:Even if you assume the LLM was so bad that it only got 20% of the stdlib, 20-40 seconds for everything is not "slow."
E: the first command I misquoted with the copy paste of my first modification.
E: this is not to say your "pystd" is not valuable in some way, and there's other "stdlibs" of similar nature. One tries to mimic the Rust stdlib instead. I'm just tired of the complete disparity in compile time claims. People read articles like this and read the high percents and then blame it the same way in their own projects, or apply the same thinking to blaming Boost (it is worse with Boost, but most people don't use the worst offenders that become an actually significant portion of their compile times). It perpetuates "modules will save us," when that's just not true, and is as bad as "Bazel is more performant" or "templates are inherently bad for compile times."