Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Greetings,

I reached my goal in reaching below 2M per worker. Testing involved running 200 workers with and without threads for the MCE demonstration and without threads for MCE::Hobo.

MCE::Flow

use strict; use warnings; use threads; # comment out for child processes use MCE::Flow; use MCE::Shared; use Time::HiRes 'time'; my $n = MCE::Shared->scalar(0); my $s = time; sub task { # do something, plenty time to see top my $v; $v = $n->incr() for 1 .. 933; } mce_flow { max_workers => 200 }, \&task; MCE::Flow::finish; printf "duration: %0.3f\n", time - $s; print $n->get(), "\n"; __END__ main process, shared-manager process, and 200 workers # with threads: e.g. use threads 498M MCE 1.827, MCE::Shared 1.824 437M MCE 1.828, MCE::Shared 1.825 <- big reduction 399M MCE 1.829, MCE::Shared 1.826 <- more reduction # without threads MCE 1.829, MCE::Shared 1.826: ~ 1744K per worker

MCE::Hobo

use strict; use warnings; use MCE::Hobo; use MCE::Shared; use Time::HiRes 'time'; my $n = MCE::Shared->scalar(0); my $s = time; sub task { # do something, plenty time to see top my $v; $v = $n->incr() for 1 .. 933; } MCE::Hobo->create(\&task) for 1 .. 200; MCE::Hobo->waitall; printf "duration: %0.3f\n", time - $s; print $n->get(), "\n"; __END__ main process, shared-manager process, and 200 workers MCE::Shared 1.826: ~ 1356K per worker

Well, I never imagined for MCE::Hobo to consume less than 1.4M per worker, let alone MCE::Flow running below 2M. MCE 1.829 and MCE::Shared 1.826 will be released later this week.

Regards, Mario


In reply to Re^2: 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-19 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found