2 ms·
The evils of premature optimization are well known but from my experience, execution often isn't the bottleneck, memory is. Which mean you can get a lot of ben
by GuB-42 9y ago
The evils of premature optimization are well known but from my experience, execution often isn't the bottleneck, memory is.
Which mean you can get a lot of benefits by optimizing your data structures. Making them smaller is a good start. Unfortunately, changing data structures can have far reaching implications, sometimes justifying a complete rewrite.
For example, going from string based hashes to raw C structures can yield massive improvements, but you need to rewrite most of the code that access it, even parts that are rarely used.
Another performance killer are deep copies. This is also hard to optimize out because if you switch to a more efficient reference, you need to mess up data for the rest of the program in every part that uses it.