Eureka! Adding a billion numbers was taking the usual single perl process 26.8 seconds but MCE spawns 8 perls (1 process per CPU core with get_ncpu), giving the fan a nice workout and doing it in 7.3 seconds! 365% faster FTW!
time perl -le '$x=1e9;$y=0;$y+=$_ for 1..$x;print$y' 500000000500000000 real 0m26.796s user 0m26.617s sys 0m0.088s time mce (your script) 500000000500000000 real 0m7.323s user 0m55.095s sys 0m0.127s
Thank you so much for the example code. I can now see the meaning of chunk_size and how to share data between processes. MCE is a really beautiful distribution with comprehensive documentation and tons of examples (and a couple of cookbooks). I'm just not familiar with the concepts and jargon of parallel processing and was feeling kinda lost, but less now. Thanks to you! :-)

Time for another go at the docs while I figure out how to adapt this to incrementing strings perl-style:

perl -le '$a="a";for(1..30){print$a++}'

In reply to Re^2: Getting started with MCE (the Many-Core Engine) by Anonymous Monk
in thread Getting started with MCE (the Many-Core Engine) by Anonymous Monk

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.