This has been rather interesting. There is an overall speedup, but not what I expected.

Thank you Mario. I was trying to use the Imager object because of failing to implement the scalar solution (for dumb reasons, like omitting type => 'gif' on the write method), as you showed in the heatmap node, with errors like:

write_multi: image 1 is not an Imager image object
or
Usage: i_writegif_wiol(IO,hashref, images...)
I've only had time to try your first demo and of course it works wonders! The speed gain is more impressive if another 9 is added to the count to make a 100,000 frame GIF (with 8 workers on 3.1GHz i7):
real	3m43.591s # Perl
real	1m19.701s # MCE
MCE also appears to use much less memory. The plain Perl version grows to almost 2GB, while the MCE workers consume a mere 6MB each until the final process that consolidates the GIF only grows to 1GB. This makes an 80MB GIF. I tried a million frames too but the heat throttled my laptop CPU to 2 GHz while it used 9GB of RAM before swapping so that took 18 minutes to make an 820MB GIF, no fault of MCE...

MCE makes the hard things easy—thanks for supercharging Perl!


In reply to Re^2: MCE segmentation fault by Anonymous Monk
in thread MCE segmentation fault 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.