Respected Monks,

An upcoming release (MCE::Shared 1.826) continues forward with regards to decreasing memory consumption. In doing so, I took out all the code pertaining to condvar, handle, and queue from inside MCE/Shared/Server.pm and re-factored the bits into MCE/Shared/Condvar.pm, Handle.pm, and Queue.pm respectively. Furthermore, I enabled AUTOLOAD inside MCE/Shared.pm and moved all the sugar-type functions inside it.

For testing, the following script loads the relevant modules and constructs a shared queue.

use strict; use warnings; use Prima qw( Application Buttons Label ); #use Parallel::ForkManager; #use MCE; #use MCE::Loop; use MCE::Hobo; use MCE::Shared; my $que = MCE::Shared->queue(); #busy loop, review top at OS level, press Ctrl-C to exit for ( 1 .. 2e9 ) { 1 }

Results reported by top (resident memory size):

20.7 Mib Prima + Parallel::ForkManager + MCE::Shared->queue v1.824 20.9 Mib Prima + Parallel::ForkManager + MCE::Shared->queue v1.825 20.7 Mib Prima + Parallel::ForkManager + MCE::Shared->queue v1.826 21.2 Mib Prima + MCE::Loop + MCE::Shared->queue v1.824 20.4 Mib Prima + MCE::Loop + MCE::Shared->queue v1.825 19.3 Mib Prima + MCE::Loop + MCE::Shared->queue v1.826 21.1 Mib Prima + MCE Core API + MCE::Shared->queue v1.824 20.4 Mib Prima + MCE Core API + MCE::Shared->queue v1.825 19.1 Mib Prima + MCE Core API + MCE::Shared->queue v1.826 18.8 Mib Prima + MCE::Hobo + MCE::Shared->queue v1.824 19.1 Mib Prima + MCE::Hobo + MCE::Shared->queue v1.825 18.4 Mib Prima + MCE::Hobo + MCE::Shared->queue v1.826 14.7 Mib Prima (only) 8.4 Mib Parallel::ForkManager + MCE::Shared v1.826 7.1 Mib MCE::Loop + MCE::Shared v1.826 6.8 Mib MCE Core API + MCE::Shared v1.826 6.1 Mib MCE::Hobo + MCE::Shared v1.826

Q. Why is memory footprint important for MCE::Hobo?

A. I have an add-on module using MCE::Hobo to send-recv data, similar to Parallel::Fork::BossWorkerAsync. Someone has requested this for a long time and decided okay will do it. But first, wanted to reduce memory consumption.

MCE::Shared 1.826 will be released sometimes this week.

Regards, Mario


In reply to Re: Prima + MCE::Hobo demonstration by marioroy
in thread Prima + MCE::Hobo demonstration by marioroy

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.