How can I get my results faster?
Other Considerations
- Modern processors try to guess what data will be used next and prefetch data
- Be careful with branches in the code during calculation loops,
e.g. if statements
- Some operations are more expensive than others
- e.g. floating point divide more expensive than multiply
- Some operations may be performed in parallel by a CPU
- e.g. floating point multiply & add as single operation
- Avoid repeating calculation — better to calculate intermediate values
and reuse