Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Optimizing with Caching vs. Parallelizing (MCE::Map)

by marioroy (Parson)
on Apr 17, 2020 at 00:00 UTC ( #11115659=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub collatz_seq {
        my $input = shift;
    ...
        $cache[$input] = $result if $input < $max;
        return $result;
    }
    
  2. or download this
    # Intel i7 laptop, Docker Container, Ubuntu + Perlbrew Perl 5.30.1
    
    ...
    collatz3_d.pl 1e7   9.170s  (d) c + reduced loop iterations
    collatz3_e.pl 1e7   7.681s  (e) d + caching less
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2021-02-27 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?