4 ms·
I think the difference here is that the problem is completely understood from the start: there's a MySQL protocol (which the author has already implemented in t
by simonw 14y ago
I think the difference here is that the problem is completely understood from the start: there's a MySQL protocol (which the author has already implemented in the past) and his project needs to be able to handle that exact protocol as quickly as possible.
- mkaufmann 14y agoThis. Also the applicability of the optimization rule depends a lot on the context. It is typically stated for a complete project. Writing a library is different from that. Depending on the kind of library you write, it could be that it is called in a hot inner loop of an outer project. So yes in that case it would make fully sense to optimize the heck out of the complete library (like e.g. a mysql client). Another point is to see the reasoning behind the optimization rule. Optimization always is associated with cost (cost of programming, additionaly complexity in the code, maintance). This cost has to be recovered from the effects of the optimization. As the number of users for a piece of code grows, the benefit of optimization rises, but the costs should be more constant. Thus at scale it also makes sense to look a smaller optimization potentials. But this does probably apply to not even 1% of the typical projects.