4 ms·
Personally, I'd use whatever built in function exists without giving it a second thought. Until it shows up as a hot spot in the profiler I don't care about per
by notaddicted 13y ago
Personally, I'd use whatever built in function exists without giving it a second thought. Until it shows up as a hot spot in the profiler I don't care about performance.
- Negitivefrags 13y agoI often see this kind of attitude expressed on internet forums as if it is the right answer in every situation. All of the options expressed here will usually be built in to the language, there is no extra implementation cost at all. Pick a vector, sorted vector, set, map or hash-map. Knowing and picking what is usually correct will not take more than a few seconds of extra thought. Your attitude leads to "generally slow" programs that are the hardest to make faster.
- rhizome 13y agoYour attitude leads to "generally slow" programs that are the hardest to make faster. Really? Even if they have proper encapsulation, separation of concerns, etc. (even unintentionally)? "Refactor the function or method later if necessary" is not the worst way to write software, and in fact I would say it's the dominant technique even when initial attempts are optimized.