Skip to content

phoenixframework/phoenix_live_view

Back Optimize stream DOM insertions by eliminating Array.from allocations (#4424)

Commit details

Optimize stream DOM insertions by eliminating Array.from allocations (#4424)

Description

Replaces repeated Array.from conversions with direct HTMLCollection indexing and parent.querySelector(':scope > :not(...)'), eliminating O(M * N) array allocations during stream element insertions. In benchmarks across collection sizes from 200 to 2,000 items, this achieves a 50x–1,400x speedup for indexed insertions and up to an 84x speedup when appending before non-stream children.

Metadata

Author
Barna Kovacs barna.kovacs@tutanota.com
Committed
Commit

Contributors

  • Barna Kovacs barna.kovacs@tutanota.com Author