3 ms·
Great point about this example being a code-size trade-off example and not an actual zero-cost example. As for actual zero-cost optimization, Chandler Carruth
by forgettableuser 11y ago
Great point about this example being a code-size trade-off example and not an actual zero-cost example.
As for actual zero-cost optimization, Chandler Carruth who works on Clang at Google gave a talk at the 2012 LLVM Developers' Meeting warning people that C++ zero-cost abstractions are more myth than reality, and things developers expect to be zero-cost are often in-fact not. He goes into detail about how the optimizers work and what the challenges are.
http://llvm.org/devmtg/2012-11/videos/Carruth-OptimizingAbstractions.mp4 http://llvm.org/devmtg/2012-11/videos/Carruth-OptimizingAbst...