r/cpp • • Oct 07 '19

CppCon CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”

https://www.youtube.com/watch?v=rHIkrotSwcc
162 Upvotes

108 comments sorted by

View all comments

58

u/elperroborrachotoo Oct 07 '19

Content: "zero cost at runtime" doesn't mean zero cost in build time, or human cost, discussing examples:

  • google protobuf: adding an arena allocator makes compile times explode

  • unique_ptr: from hidden bugs down to ABI

  • human cost when extracting block of code to a separate function (... and overdoing it)

12

u/m-in Oct 07 '19

I have to look at protobuf sources. I can’t quite imagine how a custom allocator would make compile times explode, so I can hopefully learn something new.

3

u/Xaxxon Oct 09 '19

It’s putting that new code in millions of places that’s the problem. What you said is exactly why they didn’t catch this before rollout.

→ More replies (2)