Re: Abstract, and Rationale
Marc Nieper-WiÃkirchen 10 Sep 2022 07:03 UTC
Am Fr., 9. Sept. 2022 um 23:59 Uhr schrieb John Cowan <xxxxxx@ccil.org>:
>
>> As a side remark: Using `iota` like this shouldn't be used with great care as it constructs a list in memory which is then discarded.
>
>
> Unless it is larger than the size of the GC nursery, it doesn't really cost anything.
Does it really not cost anything?
It does produce garbage in the GC nursery (unless the compiler is
"sufficiently smart"), so a minor GC will kick in earlier. This will
at least touch the then-live objects in the nursery. Depending on how
much the minor GC will be triggered, this should make a difference.
Python 2 offered `xrange' as a replacement for `range', for example.