map in void context is no longer a sin, but still it can't be used lightly instead of for, which is 25% faster than map.

It has been a great improvement from previous versions, though.

use Benchmark; print "Perl $]\n"; timethese (10000,{ "map"=> sub { map { $_ } ( 1 .. 1000 ) }, "for"=> sub { $_ for ( 1 .. 1000 ) } } ); __END__ Perl 5.006001 Benchmark: timing 10000 iterations of for, map... for: 3 wallclock secs ( 2.81 usr + 0.00 sys = 2.81 CPU) map: 5 wallclock secs ( 5.16 usr + 0.01 sys = 5.17 CPU) Perl 5.008 Benchmark: timing 10000 iterations of for, map... for: 3 wallclock secs ( 2.19 usr + 0.01 sys = 2.20 CPU) map: 4 wallclock secs ( 4.65 usr + 0.02 sys = 4.67 CPU) Perl 5.008001 Benchmark: timing 10000 iterations of for, map... for: 2 wallclock secs ( 1.72 usr + 0.00 sys = 1.72 CPU) map: 2 wallclock secs ( 2.27 usr + 0.02 sys = 2.29 CPU) Perl 5.008001 Benchmark: timing 50000 iterations of for, map... for: 9 wallclock secs ( 8.71 usr + 0.01 sys = 8.72 CPU) map: 12 wallclock secs (11.53 usr + 0.04 sys = 11.57 CPU)

In reply to Re: Re: 5.8.1 Released! by dbwiz
in thread 5.8.1 Released! by liz

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.