O'Reilly logo

Efficient C++ Performance Programming Techniques by David Mayhew, Dov Bulka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inlining Rules

There are a few relatively simple rules that we can use to make inlining decisions. Singletons and trivials are always code size, and performance wins. Trivials can be inlined without regard to their frequency of use, and singletons are inlined exactly because of their usage frequency. Frequently these “no brainer” inlinings are enough. When they are not, profiling should indicate the most likely additional candidates. The next chapter presents additional mechanisms for profitably inlining nontrivial methods.

Singletons

A singleton method is a method that has only one point of invocation within a program. This does not mean that it is invoked only once when a program is executed. A singleton can exist within a loop and be called ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required