Perl: the Markov chain saw | |
PerlMonks |
Re: Efficient selection mechanism? (Thank you all)by BrowserUk (Patriarch) |
on Jan 15, 2014 at 11:48 UTC ( [id://1070671]=note: print w/replies, xml ) | Need Help?? |
Thank you all for your suggestions. As oiskuu demonstrated, the bit mapped index -- as suggested by Corion, Salva, Choroba & hdb -- is hands down winner in the performance stakes. By using vec and string-wise boolean operations (Salva,Choroba) rather than numeral ops, I don't have to worry about the size of the small integers outgrowing the platform integer size, which is a slight but possible consideration. Mixing code from various solutions, this is what I'm using:
And that's it. Thank you all. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|