Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Useful number of childs revisited

by BrowserUk (Patriarch)
on May 08, 2015 at 12:22 UTC ( [id://1126081]=note: print w/replies, xml ) Need Help??


in reply to Useful number of childs revisited [SOLVED]

Humour me and post your results from running this simplified version of your code with arg 4(assuming you have 4 cores?) & 50:

#!/usr/bin/env perl use strict; use warnings; use Math::BigInt; use Parallel::ForkManager; use Time::HiRes qw ( time ); use feature qw(say); my $processes = shift; my $pm = Parallel::ForkManager->new( $processes ); say qq(processes: $processes); my $start=time; for my $number ( 1 .. 50 ) { $pm->start( $number ) and next; my $factorial = Math::BigInt->bfac( 2000 ) for 1 .. 10; $pm->finish( 0 ); } $pm->wait_all_children; say qq(fork: ), time - $start;

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Replies are listed 'Best First'.
Re^2: Useful number of childs revisited
by karlgoethebier (Abbot) on May 08, 2015 at 12:53 UTC
    "Humour me..."

    My pleasure:

    karl@host~$ ./buk.pl 4 processes: 4 fork: 13.0191400051117 karl@host:~$ ./buk.pl 50 processes: 50 fork: 7.12985706329346

    My best regards, karl

    P.S.: British humour?

    «The Crux of the Biscuit is the Apostrophe»

      Could also post runs with 8, 16 & 32 please.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
      In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
        karl@host:~$ ./buk.pl 8 processes: 8 fork: 11.0194890499115 karl@host:~$ ./buk.pl 16 processes: 16 fork: 10.0188848972321 karl@host:~$ ./buk.pl 32 processes: 32 fork: 8.01892495155334

        «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1126081]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 05:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found