Results: The time needed to compute a Mandelbrot from a Linux VM configured with 4 cores at 2.6 GHz (Haswell Core i7).

# width => 1280, height => 1024   (  1.3 million pixels )

  Original       10.622 secs  eval statements slow it down
  Imager          7.219 secs
  GD              3.689 secs
  MCE + Imager    3.331 secs
  MCE + GD        0.565 secs
  MCE + GD + C    0.139 secs

# width => 3840, height => 3072   ( 11.8 million pixels )

  Original       96.129 secs  eval, ditto
  Imager         64.229 secs
  GD             33.190 secs
  MCE + Imager   29.029 secs
  MCE + GD        4.344 secs
  MCE + GD + C    0.436 secs

# width => 6400, height => 5120   ( 32.8 million pixels )

  Original      259.215 secs  ditto
  Imager        178.817 secs
  GD             93.168 secs
  MCE + Imager   79.986 secs
  MCE + GD       12.296 secs
  MCE + GD + C    0.997 secs  <-- fast is possible :)
  MCE + GD + C    1.002 secs  <-- repeatable
  MCE + GD + C    0.989 secs  <--

Update: Both MCE + GD and MCE + GD + Inline::C compute the upper half only.

Update: The writer is no longer the hold up for MCE + GD and MCE + GD + Inline::C. The logic was updated to minimize GD calls by 56x.

Update: Reduced IPC for the MCE + GD + Inline::C demonstration. Wanted to see if possible to reach below 1.0 second. Btw, the time is the unix time which includes the time to launch Perl, load modules, spawn workers, compute the Mandelbrot 6400 x 5120 (upper half only), copy/flip/copy into bottom half, write the image, and shutdown workers. It is mind-boggling.

Thank you karlgoethebier and perlmonks. Thank you also to the original author wherever you are.

Kind regards, Mario


In reply to Re^2: Refactoring: Better Variable Names For Better Understanding? [SOLVED] by marioroy
in thread Refactoring: Better Variable Names For Better Understanding? [SOLVED] by karlgoethebier

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.