This repository contain tips, tutorials and examples on performance optimisation.
Simple tips to improve the performance of your code (no matter what programming language you are using).
- Build with optimisations enabled (and debug off).
- Don’t print or log in performance critical areas (avoid IO).
- Don’t calculate the same thing more than once.
- Minimise memory allocations.
- Avoid copying data (pass references to it).
- Store data as close to the data that it is used with as possible.
- Iterate through arrays in order, when possible, don’t jump around.
- Michael Abrash's Graphics Programming Black Book - Covers far more than graphics, now out of print but an online version is available through this repo.
- Efficient Memory Programming
- The Art of Writing Efficient Programs