solid-select icon indicating copy to clipboard operation
solid-select copied to clipboard

Performance degradation with large option sets – missing lazy rendering (virtual scrolling)

Open handbremse opened this issue 9 months ago • 0 comments

Currently, solid-select renders all available options into the DOM as soon as the dropdown opens. With large option sets (e.g., 500+ items), this results in noticeable performance drops — especially during opening and scrolling.

Problem:

  • All options are rendered at once, regardless of whether they are visible.
  • This leads to unnecessary DOM updates and memory usage.
  • Users experience UI lag, particularly on lower-end devices or mobile browsers.

Expected behavior:

  • Only the visible subset of options (plus a small buffer) should be rendered in the DOM.
  • Non-visible options should remain virtual and not occupy DOM space ("windowing").

Suggested solution:

  • Integrate @solid-primitives/virtual to enable virtualized option rendering.
  • Optionally allow users to override the default option list component to implement their own virtualization logic.

Benefits:

  • Significantly improved performance for large datasets.
  • Reduced DOM node count and rendering overhead.
  • Better user experience on all devices.

Example scenario: Rendering 1,000 options currently results in 1,000 DOM nodes. With virtualization, only around 10–15 visible items would be rendered at any given time.

handbremse avatar May 31 '25 19:05 handbremse