in reply to Re: does a hash element as a loop parameter cause significant slowdown?
in thread does a hash element as a loop parameter cause significant slowdown?
> The list 1..$n1 is created in memory and then iterated over so $n1 is only evaluated once.
Nitpick:
you are right that $n1 is only evaluated once, but only old versions "created" the whole "list in memory".
This was optimized away ages ago to allow $a..$b to act like an iterator. Maybe 5.10ish?
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: does a hash element as a loop parameter cause significant slowdown?
by pryrt (Abbot) on Sep 09, 2023 at 00:00 UTC | |
by LanX (Saint) on Sep 09, 2023 at 12:19 UTC |