http://qs1969.pair.com?node_id=11141574


in reply to Re: Performance issue in the loop.
in thread Performance issue in the loop.

Thanks for suggestions.

I ran your code and it worked a little bit slower than my program (optimized variant).
Also I observed that by few-fold increasing $n, the factor of ~1.5x isn't changing.
P.S. I used v5.30.

Replies are listed 'Best First'.
Re^3: Performance issue in the loop.
by NERDVANA (Deacon) on Feb 23, 2022 at 20:23 UTC
    Ah, nevermind, I realize I was comparing to your old code, not your optimized one. Yes the optimized one gets rid of the double check of $sums$j-$i so that works too.

    Still, List::Util::max is faster than (sort...)[0]