Chapter 10

Low-Level Efficiency Issues

There are only two qualities in the world: efficiency and inefficiency; and only two sorts of people: the efficient and the inefficient

—George Bernard Shaw

John Bull's Other Island (1904)

The efficiency techniques of the previous chapter all involved fairly significant changes to an algorithm. But what happens when you already are using the best imaginable algorithms, and performance is still a problem? One answer is to find what parts of the program are used most frequently and make micro-optimizations to those parts. This chapter covers the following six optimization techniques. If your programs all run quickly enough, then feel free to skip this chapter. But if you would like your programs to run faster, ...

Get Paradigms of Artificial Intelligence Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.