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

Re^2: Performance issue in the loop.

by etj (Chaplain)
on Feb 27, 2022 at 03:53 UTC ( #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? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2022-10-04 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (18 votes). Check out past polls.

    Notices?