Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 musing on the Monastery: (5)
As of 2020-09-30 00:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I don’t succeed, I …










    Results (154 votes). Check out past polls.

    Notices?