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

Re^2: Performance issue in the loop.

by etj (Deacon)
on Feb 27, 2022 at 03:53 UTC ( [id://11141665]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $n = 2e4;
    @input = map int rand 1e5, 1 .. $n;
    $sums = zeroes long, scalar @input;
    $vec  = pdl long, \@input;
    with_time { my @max = map +($sums( 0 : -$_ - 1 ) += $vec( $_ : -1 ))->
    +maximum, 0 .. $#input };
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 12:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found