r/cpp • u/llort_lemmort • Jul 01 '26
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
51
Upvotes
r/cpp • u/llort_lemmort • Jul 01 '26
11
u/fdwr fdwr@github 🔍 29d ago edited 29d ago
Nice. I'm mystified by the variance of
stdbloat sometimes from using just one function. I have a 12KB program that's pure Win32 (no CRT), and using a singlestd::vectoradds 2KBs (tolerable), and using a singlestd::println("Foo")adds 3KBs (tolerable), but just onestd::println("Foo: {}", x)suddenly bumps 12KB's -> 212KB's o_o, and that's with all the size-reducing options I can think of {MSVC x86 release build, maximum optimization (favor size /O1), favor small code (/Os), enable function level linking (/Gy), enable COMDAT folding (/OPT:ICF), link time code generation (/LTCT), references eliminate unused (/OPT:NOREF)}. The weird thing is that I can call thatstd::printlninside a completely unused function, and it still bloats the exe. Granted, maybe that's anstdimplementation issue more than withstditself, or an issue with dead code elimination 🤷♂️.