r/cpp • u/Little-Reflection986 • Feb 16 '26
Favorite optimizations ??
I'd love to hear stories about people's best feats of optimization, or something small you are able to use often!
135
Upvotes
View all comments
Show parent comment
1
u/jmonschke Mar 17 '26
That is why I try to minimize dynamic allocations in general, and keep things on the stack, and statically allocated within objects, and pre-allocating space for containers on construction, as much as possible.