Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by marioroy (Parson)
on Apr 14, 2020 at 23:21 UTC ( #11115540=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $n >> 1;
    
  2. or download this
        while ($n != 1) {
            $result += $cache[$n], last
    ...
    
            $n = $new_n;
        }
    
  3. or download this
        while ($n != 1) {
            $result += $cache[$n], last
    ...
    
            $n = $new_n;
        }
    
  4. or download this
        while ($n != 1) {
            $result += $cache[$n], last
    ...
    
            $n = $new_n;
        }
    
  5. or download this
    #!/usr/bin/perl
    use strict;
    ...
    
    @long_seqs = sort { $b->[1] <=> $a->[1]} @long_seqs;
    say "$_->[0]: $_->[1]" for @long_seqs[0..19];
    
  6. or download this
    $ time perl collatz3_a.pl 1e7
    
    ...
    5598635: 595
    8397953: 593
    6298465: 590
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2020-11-30 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?