"Make a function inline directs the compiler that it may choose to place a copy of the function's code directly into each place the code is used. In the cases where the compiler does so, it avoids generating a function call."
"If you're looking to improve efficiency in some way, always look to your algorithms and data structures first."
"Finally, note another practical reason for this: Profilers are a lot less good at identifying which inlined functions should NOT be inlined."
"Avoid inlining or detailed tuning until performance profiles prove the need."
"Without atomic integer operations, copy-on-write typically incurs a significant performance penalty. Even with atomic operations, COW can make common String operations take nearly 50% longer, even in single-threaded programs."
"In general, copy-on-write is often a bad idea in multithread-ready code. That's because the calling code can no longer know whether two distinct String objects actually share the same representation under the covers, so String must incur overhead to do enough serialization so that calling code can t"
"Most of COW(copy-on-write)'s primary advantage for small strings could be gained without COW by using a more efficient allocator."
作者简介
对每一位C++爱好者或C++专业程序员来说,Herb Sutter的名字应该不会让人感到陌生。作为ISO/ANSI C++标准委员会的委员,Herb Sutter不仅是C++程序设计领域公认的专家,还是深受程序员喜爱的技术讲师和作家。Herb Sutter在互联网上主持的Guru of the Week专栏广受欢迎,几乎成为每一位C++程序员的网上必读物。本书就是Guru of the Week的最新精华总结。