4 ms·
the intermediate objects are still created, they just aren't given names/saved to a specific memory location somewhere do you mean like streaming APIs where in
by recursivedoubts 6mo ago
the intermediate objects are still created, they just aren't given names/saved to a specific memory location somewhere
do you mean like streaming APIs where intermediate data structures aren't created? Is that what javascript does w/map() etc?
- azangru 6mo ago> the intermediate objects are still created Yeah; this is what the new iterator methods were intended to solve https://x.com/MozDevNet/status/2029527411424219254 https://x.com/MozDevNet/status/2029527411424219254
- zamadatix 6mo agoBasically? // This type of usage creates intermediates array.map().filter() // But these would not? array.values().map().filter().toArray() array.values().reduce()
- phpnode 6mo agounfortunately iterators have their own set of overheads and it's not clear that these new methods are any faster for most use cases.