Library/Software Engineering/Optimization

Principles

 * 1) Remove all unnecessary work.
 * 2) Restructure the algorithm to take advantage of the tools do best.

Restructure for your toolset
The toolset means the compiler as well as the CPU. It may mean the GPU and the graphics driver. It may mean the interpreter.