And faster too (making the obvious benchmark addition):
Rate set map map++ GF Bart
set 2288/s -- -84% -91% -92% -93%
map 14566/s 537% -- -46% -48% -58%
map++ 26756/s 1070% 84% -- -4% -23%
GF 27881/s 1119% 91% 4% -- -19%
Bart 34580/s 1412% 137% 29% 24% --
See Re: Using map to create a hash/bag from an array for the original code
DWIM is Perl's answer to Gödel
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||