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

Lazy Evaluation

Many performance optimizations gain speed by taking a computation and performing it in a more efficient manner. Some of the big performance wins in the optimization game are achieved not by merely speeding up a computation but by eliminating it altogether.

Issues of lazy evaluation are more likely to present themselves on large-scale code. If you are coding a solution for, say, the Traveling Salesman Problem (TSP), the problem description fits in one paragraph and the implementation is less than 100 lines of code. The TSP problem description and implementation can fully be comprehended by a single developer. That's typical of small scale projects. In such circumstances you are highly unlikely to find costly computations that are ...

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