3 ms·
I think the best summary of how to do this is to take a look at Herb Sutter's three article set on "Minimizing Compile-Time Dependencies". https://herbsutter.c
by stargrazer 9y ago
I think the best summary of how to do this is to take a look at Herb Sutter's three article set on "Minimizing Compile-Time Dependencies". https://herbsutter.com/gotw/ https://herbsutter.com/gotw/
"The Compilation Firewall", or pimpl idiom, is a clever mechanism for getting code out of the header: https://herbsutter.com/gotw/_100/ https://herbsutter.com/gotw/_100/
- cheez 9y agoI use this liberally. Generally, it is a runtime performance issue only on repeated allocations for which you can optimize if needed. Once-only allocations can be ignored when using compiler firewalls.
- lallysingh 9y agoAnd the second cache miss: 1 for the cache miss, 1 for the actual object.
- cheez 9y agoRight. Usually the entire application is not performance critical. Only certain sections are. For that part of the application, profile and optimize.