4 ms·
I think what he’s saying here is you can’t skip the basic math step to arrive at good performance. Staring at profiling results will lead you to a local minima
by klysm 1y ago
I think what he’s saying here is you can’t skip the basic math step to arrive at good performance. Staring at profiling results will lead you to a local minima
- jmull 1y agoYeah, that's why I think it's nonsense. Measuring doesn't mean don't think. Measuring and thinking are two different things. You need to do them both to optimize effectively.
- Joel_Mckay 1y agoOr optimizing a scheduling noop loop dozens of times given local encapsulation obscures global functional context. The fact remains most projects that do small trivial modular prototypes first will ultimately know which paths are viable before painting themselves into a corner algorithmically. Best of luck =3
- deleted 1y ago[deleted]
- cogman10 1y agoProfiling doesn't mean you don't do the math. Profiling is simply there to show you that "hey, this is where the problems actually are". You do profiling because it's WAY too easy to get obsessed about theoretical problems when a simple measurement will show you the actual problems. You do the math on the actual problem location, not a method with O(n!) which only gets called with n=3. You still have to look at the entire call stack when profiling (which means thinking about the overarching algorithm).
- absolutelastone 1y agoI think the person you are responding to is criticizing the original "mantra" quote not the author's criticism of it(?)
- 9rx 1y agoWell, he's saying that intuition does work... But does it really? If a problem area is so intuitively obvious, why would you introduce the problem in the first place? In reality, performance optimizations are usually needed where you least expect them. Which means that you can't get there intuitively. Hence, the suggestion of using profiling to help track down where the problem is instead.
- mystified5016 1y agoDo you want to claim you've never written quick and ugly code to get something working to come back and fix it up later? Pretty much everyone I know will throw down an O(n^2) algorithm or whatever in their first pass and replace it with something more thought out once they have the time to think deeply about it. If you're fretting about optimization at every stage of development, you're really doing it wrong. This is precisely the type of early optimization that everyone and their dog will tell you is bad. You should focus first on making your program work and laying out the logic and data flows. Optimization does not matter until the program is almost finished.
- tough 1y agoOne could even say optimization does not matter until the program is already running.
- deleted 1y ago[deleted]
- deleted 1y ago[deleted]
- 9rx 1y agoPurposefully introducing underperforming code as a tradeoff to meet some other goal (faster delivery, for example) is something else entirely. It doesn't require intuition or profiling – at most requiring only memory of the choice. A fun aside, but not related to what we're talking about.
- patrick451 1y ago
- deleted 1y ago[deleted]
- bqmjjx0kac 1y agoFYI, the author is a woman.