in reply to Re^3: Generating Unique numbers from Unique strings
in thread Generating Unique numbers from Unique strings
Before writing extra code that you think will make a performance difference, benchmark the code and see where you are at. Start with the most straight forward HLL code that implements a reasonable algorithm. Use the features of the language because they have been highly optimized and are likely to produce good results with a clear algorithm.
An array access by index will be faster than a hash table lookup, but not by all that much unless you do this a bazillion times. BenchMark your code and see for yourself.
Update: in my experience the 80/20 or even the 90/10 rule applies. 10% of the code does 90% of the "real work". Forget about optimizing the 90%, you must find the 10% where it really matters.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Generating Unique numbers from Unique strings
by BrowserUk (Patriarch) on Apr 03, 2016 at 19:52 UTC | |
by Marshall (Canon) on Apr 03, 2016 at 19:56 UTC |