Designing Embedded Networking Applications: Essential Insights for Developers of Intel IXP4XX Network Processor Systems

We should forget about small efficiencies, say about 97% of the time; premature optimization is the root of all evil.
Donald Knuth
Performance tuning is one of the black arts of embedded system development. You will almost certainly spend some portion of your development schedule on optimization and performance activities. Unfortunately, these activities usually seem to occur when the ship-date is closing in and everyone is under the most pressure.
However, help is at hand. We have helped a number of customers tune many diverse applications. From these real-life experiences we have developed a useful toolbox of tricks and techniques for performance tuning, which are summarized in this chapter. These best-known methods appear in "pattern" form. While many of the patterns are generally applicable on any performance-tuning work, some are specific to Intel XScale core and the Intel IXP4XX network processors. We have organized the optimization and performance tuning patterns under the following headings:
General Approaches
Networking Techniques
Code and Design
Intel XScale Core and Intel IXP4XX Network Processor-Specific
Operating System Specific
Each performance improvement suggestion is documented in the form of a pattern (Alexander 1979) (Gamma et al. 1995). A pattern is "a solution to a problem in a context," a literary mechanism to share experience and impart solutions to commonly occurring problems. Each pattern contains these elements:
Name for referencing a problem/solution pairing.
Context the circumstance in which we solve the problem that imposes constraints on the solution.
Problem