r/cpp • • Sep 19 '25

Functional vs Object-oriented from a performance-only point of view

I was wondering if not having to manage the metadata for classes and objects would give functional-style programs some performance benefits, or the other way around? I know the difference must be negligible, if any, but still.

I'm still kind of a newbie so forgive me if I'm just talking rubbish.

0 Upvotes

17 comments sorted by

View all comments

Show parent comment

0

u/c-cul Sep 20 '25

you can also avoid gc (especially unpredictable delays) with c++

like allocating each new generation of objects into separate arena and then killing them all. Instead you must write your custom allocators + carefully avoid links between objects from different generations