O'Reilly logo

Code Craft by Pete Goodliffe

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

Chapter 11: The Need for Speed

Mull It Over

  1. Optimization is a process of making trade-offs—sacrificing one quality of code for another desirable quality. Describe the kinds of trade-offs that lead to a performance increase.

The kinds of decisions that profoundly influence a program's performance are:

  • Number of features versus size of code

  • Program speed versus memory consumption

  • Storage and caching versus computation on demand

  • Guarded approach versus unguarded; optimistic versus pessimistic

  • Approximate calculations versus exact calculations

  • Inline versus function call; monolithic versus modular

  • Indexing an array versus searching a list

  • Passing a parameter by reference or address versus passing a copy

  • Implemented in hardware versus software

  • Hard-coded, direct ...

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