(no title)
Hardliner66 | 2 years ago
If you micro-optimize every piece of software you write that will be a problem. First, it’s a tradeoff. You are going to produce code that abuses obscure methods or hard to follow semantics in order to theoretically boost performance. Why theoretically? Because your whole optimization is pointless unless your code runs as a separate application and you already profiled it on the target where it’s supposed to run.
Second, you’re wasting time for a benefit, that’s not accounted for. You are not paid to produce the fastest code known to man. You are paid to implement features. And unless the wins are huge or the optimization is a no-brainer (e.g.: string builder vs string concatenation), you’re delivering the wrong values.
So while we do care about performance (albeit a bit less than we probably should), the performance problems that we have are not solved by micro-optimizing some piece of code like it’s done in coding competitions. You need an understanding about the whole system, how parts interact and what the performance requirement is. Because even if you reduce the time it takes for your code to run by 99%, it’s of no use if the code than needs to wait for a network call anyway, making the whole effort worthless, because the overall time is the same.
So while it’s a nice exercise, it’s not what’s needed in the field. Just make sure you do the obvious optimizations and try to avoid the obvious pessimizations.
No comments yet.