in reply to "Just use a hash": An overworked mantra?
But, if I can quote from Donald_Knuth "Premature optimization is the root of all evil."
You need to profile the real code to find out where the bottleneck is, As BrowserUK points out the time to read the file swamps any sort of improvement you might make.
Using a hash as a default option is still probably the right one, it's simple, understandable and works when your data is strings, or dates or anything else. An array on the other hand can only be used when your data is an integer, and you know that the range of the data is small. So in this very specific case a array will be better but not in the general case.
Thanks for the interesting post, but to answer your question -- NO it's not! :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: "Just use a hash": An overworked mantra?
by blakew (Monk) on Nov 17, 2011 at 18:00 UTC | |
by Tux (Canon) on Nov 17, 2011 at 18:38 UTC | |
by blakew (Monk) on Nov 17, 2011 at 19:47 UTC |