Ha ha, I'd already tried that and couldn't measure any difference. I'd also tried losing the uc function by increasing the hash to include lower case letters, but that was a bit slower. Update: hippo suggested that while I was typing. :)

The most promising approach may be to find an alternative to:

M=>1000, D=>500, C=>100, L=>50, X=>10, V=>5, I=>1
to do the mapping. For example, 'M1000D500C100L50X10V5I1' and use a regex or something. I made a few half-hearted attempts but didn't find anything faster.

It might also be faster to remove the reduce and do the summing in another uglier way ... but reduce is so elegant I couldn't bring myself to try anything along those lines, that would be like losing an old friend. :)


In reply to Re^4: Risque Romantic Rosetta Roman Race by eyepopslikeamosquito
in thread Risque Romantic Rosetta Roman Race by eyepopslikeamosquito

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.