in reply to A better way of lookup?
First, thanks to everyone who responded. I wasn't expecting much response to the question; and was surprised by the multitude of alternatives offered. Thank you all.
Upshot: I coded up several of the more distinct variations in JS and plugged them into the JS code and made a (probably clumsy and naive) attempt to measure the results; and the outcome was that I couldn't discern any consistent benefit from any of them.
Perhaps if I had more experience with JS; or if the table size was larger; but I suspect that JIT compilation and optimisation is playing a part here.
So, for now, I'm sticking with the crudely simple version I posted in the OP for this purpose, and I'll re-visit this thread next time I have the same problem either in Perl; or with a larger table size.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A better way of lookup? (Thanks and outcome.)
by Anonymous Monk on Apr 27, 2015 at 22:43 UTC | |
by BrowserUk (Patriarch) on Apr 27, 2015 at 23:32 UTC |