Some notes about software optimization:
- Some universal code optimization rules (Blog Virtuous Code): Good advices about when you are not only not optimizing, but doing just the opposite.
Naturally, the numbers above refer to the relative performance of the team in delivering on business goals.
- Infographics: Operation Costs in CPU Clock Cycles (Blog IT Hare): Let's go deep inside your program and have a look at how much time things take. For example, an integer division, cpu cache access, context change in a thread,... Special attention to C++ primitives.
Whenever we need to optimise the code, we should profile it, plain and simple. However, sometimes it makes sense just to know ballpark numbers for relative costs of some popular operations, so you won't do grossly inefficient things from the very beginning (and hopefully won't need to profile the program later 🙂 ).
- 11 Best Practices for Low Latency Systems (Codependents): When your software has important performance requirements, you begin to read articles like this. These are practical tips that you can use to check if you are doing something the other way round.
- Choose the right language
- Keep it all in memory
- Keep data and processing colocated
- Keep the system underutilized
- Keep context switches to a minimum
- Keep your reads sequential
- Batch your writes
- Respect your cache
- Non blocking as much as possible
- Async as much as possible
- Parallelize as much as possible
See you next time!