🟠 Multiview child_at heap computation per call duplicates render logic #8

Open xenolandscapes.com
Open opened by xenolandscapes.com

Summary #

src/cursed/multiview.lua:child_at recomputes offsets and heights identically to render, leading to O(n) cost per mouse event.

The Problem #

child_at walks all children, calling wrap_rows for each line, every time a mouse event arrives. This duplicates the same computation that Multiview.render does. On large restricted views with many lines, this adds cost per mouse move/drag.

Impact #

  • performance: Mouse events in multiview invoke duplicate offset/height calculations, increasing latency on each mouse motion.

Cache the computed offsets from render in mv.offsets and reuse them in child_at. Invalidate on scroll or resize.

References #

335f21a5..335f21a5

Sign up or Sign in to add to the discussion.