3 ms·
> use of a feature or function without understanding why and how it works can lead to really interesting performance problems, even if the code is functionally
by bpicolo 11y ago
> use of a feature or function without understanding why and how it works can lead to really interesting performance problems, even if the code is functionally correct
Which you shouldn't worry about until a profile shows it's an issue. Otherwise, having a basic understanding of data structure usage is the actual critical bit
- nirvdrum 11y agoGiven the choice between two functionally correct data structures with different performance profiles, you should pick the one more appropriate to the task at hand. A lot of performance issues can be proactively avoided with a bit of analytical thinking, but you do need to know how your data structures work and what their trade-offs are. Profilers are wonderful tools, but in the 15 years I've been professionally writing software the number of people I know that have ever used one numbers in the low 10s. Of those, the number that can derive meaningful data from a profile is even smaller. And finally, those that can spot "death from a thousand cuts" situations (quite common) from the proverbial method that takes 20% of all CPU time is even smaller yet. Profiling has a place, of course. But it's tricky to get right, incredibly time consuming without sampling, and often doesn't give you a complete picture. It's the performance equivalent of a debugger and really should be a fallback, not the only tool in your arsenal.
- AnthonyMouse 11y agoThat doesn't necessarily work at the level of fundamental data structures. If you make the same mistake in 1500 different places the profiler won't show any of them as particularly hot but your program will still be slow.