To get the best possible CPU performance, follow these two overall guidelines:
Compile all object files with at least -O2. Note that the compiler option for debugging, g, turns off all optimization. If you must run the debugger on optimized code, you can use g3 with -O2 with limited success. If you're not compiling with -xansi (the default) or -ansi, you may need to include float for faster floating-point operations.
On certain platforms, other compile-time options, such as -mips3 or -mips4, are available.
The CPU tuning strategy focuses on developing fast database traversal for drawing with a simple, easily accessed data structure. The fastest rendering is achieved with an inner loop that traverses a completely flattened (non-hierarchical) database. Most applications cannot achieve this level of simplicity for a variety of reasons. For example, some databases occupy too much memory when completely flattened. Note also that you run a greater risk of cache misses if you flatten the data.
Display lists have the following advantages: