Transforming the continuous into this discrete (sampling)
Jack Bresenham
Optimize Inner Loops
Optimize those code fragments where the algorithm spends most of its time.
Often these fragments are inside loops.
Remove unnecessary method invocations
Use incremental calculations
Low-Level Optimizations
Addition and Subtraction are generally faster than Multiplication.
Multiplication is generally faster than Division.
Using tables to evaluate discrete functions is faster than computing them
Integer caluculations are faster than floating-point calculations.
Avoid unnecessary computation by testing for various special cases.
The intrinsic tests available to most machines are greater than, less
than, greater than or equal, and less than or equal to zero (not an arbitrary
value).