Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by Laurent_R (Canon)
on Apr 14, 2020 at 13:53 UTC ( [id://11115520]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ time perl collatz.pl
    837799: 525
    ...
    real    1m37,551s
    user    1m9,375s
    sys     0m21,031s
    
  2. 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];
    
  3. or download this
    real    0m34,207s
    user    0m34,108s
    sys     0m0,124s
    
  4. 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];
    
  5. or download this
    $ time perl collatz3.pl
    837799: 525
    ...
    real    0m1,755s
    user    0m1,687s
    sys     0m0,061s
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-26 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found