logoalt Hacker News

SuperV123406/17/20251 replyview on HN

But do you have actual proof for your first claim? Isn't it possible that the "constant vigilance" is optimizing that ~10% that doesn't really matter in the end?


Replies

fsloth06/18/2025

Yes.

For example C++ can shoehorn you to a style of programming where 50% of time is spent in allocations and deallocations if your code is otherwise optimal.

The only way to get that back is not to use stl containers in ”typical patterns” but to write your own containers up to a point.

If you didn’t do that, youd see in the profiler that heap operations take 50% of time but there is no obvious hotspot.

show 1 reply