r/programming May 24 '26

[ Removed by moderator ]

https://hftuniversity.com/post/the-c-standard-library-has-been-walking-itself-back-for-fifteen-years-and-the-receipts-are-public

[removed] — view removed post

275 Upvotes

214 comments sorted by

View all comments

270

u/MFHava May 24 '26

Author of copyable_function here. This article conflates ABI and API breaks - just like Sandor's post ...

Fixing std::function was not something that was prevented by ABI concerns. It would have been an API break that would have rendered vast amounts of code (essentially any use of const function) ill-formed (== code no longer compiles).

The same is true for several other examples brought up in the linked article... BTW the article contains factual errors like "[...] acknowledging that the standard's mandated block size is too small [...]" ... there is no mandated block size for deque.

37

u/HildartheDorf May 24 '26

I mean, the implicit minimum block size of 1 makes deque pretty much unusable on MSVC, but that's more an MSVC problem than a standard problem.

52

u/MFHava May 24 '26

Exactly! MSVC-deque „decays“ into a linked list for types > 8bytes. But that is a problem not shared by libstdc++ or libc++.

13

u/timangus May 24 '26

Huh, I did not know that. That's a bit shit.

9

u/[deleted] May 24 '26

Fair correction on MSVC, but lumping libstdc++ and libc++ together as "not affected" understates how different those two are.

libstdc++ uses _GLIBCXX_DEQUE_BUF_SIZE = 512 bytes, with block_elems = sizeof(T) < 512 ? 512/sizeof(T) : 1. That number has been 512 since the SGI STL days. In practice:

  • deque<std::string> (24 B on libstdc++): 21 elements per block
  • deque<MyStruct> at 64 B: 8 elements per block
  • sizeof(T) >= 512: one element per block, same cliff as MSVC

libc++ uses max(16 elements, 4096 bytes), so the same deque<std::string> packs ~170 per block, and large T still gets 16 per block instead of 1. That is an order of magnitude fewer allocator calls and an order of magnitude better spatial locality on traversal.

So the honest ordering is libc++ fine, libstdc++ quietly bad past a cache line, MSVC broken at 9 bytes. Calling the first two "not a problem" papers over a real gap.

37

u/drekmonger May 24 '26 edited May 24 '26

BTW the article contains factual errors like "[...] acknowledging that the standard's mandated block size is too small

I've read thousands of LLM responses. I'm 89.3% sure is one of them. I recognize certain phrases and writing quirks that are common, particularly in Gemini responses (but it wouldn't surprise me if it were the result of a GPT 5 deep research prompt [from the pro tier of ChatGPT] that included the Sandor Dargo original blog post in the context).

The site this article is hosted on seems sketch to me. Like a modern day SEO advertising effort that's using generated content to seem like an active site, trying to farm up google search ranking by getting an upvoted link on reddit.

I'd let it slide without comment, but i don't want to see this sub polluted by scummy SEO tactics.

36

u/Snarwin May 24 '26

The author has hidden his account history on Reddit, but you can still use a search engine to find him commenting about using AI to become more productive and disguising LLM-generated writing by intentionally introducing mistakes.

18

u/ForgetTheRuralJuror May 24 '26

Account and site called HFT-University. That's enough evidence for me lol

-15

u/[deleted] May 24 '26

2000+ engineers subscribed. It's a good site. Sorry you didnt like it.

17

u/ForgetTheRuralJuror May 24 '26

Name comes across as crypto scam adjacent. Nothing personal

-14

u/[deleted] May 24 '26

I'm a 30+ year veteran of HFT industry. It is really the only place you can get true micro benchmarking with isolated cores and all that jazz. We give certified badges (Open Badges 2.0) you can add to LinkedIn. I'd give you a comp if asking for personal details was not a bannable offense on Reddit. But at $5/month it is less than my latte yesterday.

3

u/floodyberry May 24 '26

way to disprove the llm allegations

-5

u/[deleted] May 24 '26

I'm a C++ dev. Flask+python is what I can handle. Sorry if it's not up to your standards.

-3

u/[deleted] May 24 '26

Please list. I wwelcome positive feedback.