In general optimizing something just means “making it better” or closer to the optimal, i.e. best possible performance.
When discussing optimizing code, there are two main focuses; optimizing memory usage and optimizing processing speed. In general you achieve one of these by sacrificing the other.
For example if you are designing a game for an older console system, you’d want to focus heavily on optimizing the usage of the limited, non-upgradable RAM memory. That means getting creative with how you fetch and store data in your code so that your game doesn’t max out the available memory.
If processing speed is the end-goal, then often that means sacrificing some memory optimization and storing more information in RAM and using creative algorithms to process data more efficiently.
To be more precise programmers can evaluate a piece of code and give it a complexity value that essentially tells other programmers how efficient/optimized it is for memory and speed. Check out [Big O notation](https://en.wikipedia.org/wiki/Big_O_notation) and [computational complexity](https://en.wikipedia.org/wiki/Computational_complexity) if you want to learn more about that.
Latest Answers