Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 749 Bytes

File metadata and controls

16 lines (11 loc) · 749 Bytes

showcase of performance issue with bind:clientWidth in Svelte

Note that this also applies to:

  • bind:clientHeight
  • bind:offsetWidth
  • bind:offsetHeight

There seems to be a linear performance decrease when it comes to using bind:clientWidth (or any of the other similar properties). Every new element with binding adds around the same overhead in execution time.

It's difficult to give an exact number, but rendering stops feeling instant (200ms) at around only 30 elements that use bind:clientWidth (or others), while we can go into the thousands without the binding and have no performance issues.

this is kinda bad

demo

Screen.Recording.2023-03-14.at.19.49.11.mov