3 ms·
> I would say C++ is more like a zero runtime-cost abstraction language (in release builds). Well, other than the "zero-cost" features that increase code size.
by vardump 8y ago
> I would say C++ is more like a zero runtime-cost abstraction language (in release builds).
Well, other than the "zero-cost" features that increase code size. For example careless use of heavy template classes can generate a lot of code.
In other words, in C++ it's very easy to generate a lot of code from seemingly innocent constructs.
Instruction cache misses, page faults (and to lesser amount TLB misses) are not zero cost.
- ben509 8y agoTo your point, cost (or strength) should always consider size as well as time. It would be nice to have a tool that could compute the size impact of a given line.