r/cpp • • 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

185 comments sorted by

View all comments

Show parent comment

58

u/h2g2_researcher Feb 16 '26

It's from OpenMP (with MP being "Multi-Processor"). Basically it takes a for loop and automatically splits it up into threads. It is possible to do the same by hand, but OpenMP does it automatically just via the compiler #pragma.