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.
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]