Possible to improve x-for performance with large lists? #570
Replies: 4 comments 18 replies
-
Yeah, it is quite noticeable. Nice job on providing the codepens. |
Beta Was this translation helpful? Give feedback.
-
Hi @ragulka - the performance difference is quite noticeable. Great work on providing three different CodePens. A couple of thing to note:
|
Beta Was this translation helpful? Give feedback.
-
I wonder if a plugin could be written along the lines of Tanstack Virtual, to handle this? |
Beta Was this translation helpful? Give feedback.
-
We've recently merged a PR to improve keyboard navigation performance in large lists drastically for the X-listbox and X-combobox components. Just a heads up. |
Beta Was this translation helpful? Give feedback.
-
I ran into some performance issues with
x-for
while trying to implement a country dropdown in Alpine with keyboard support. The issue becomes apparent when trying to navigate the list with keyboard up/down arrows while having browser devtools open.I've created a minimal test case for Alpine, Vue and Vanilla JS:
The Vue and Vanilla JS test cases doesn't seem to suffer from any kind of performance issues (even with devtools open), while Alpine becomes rather sluggish.
My guess is that this is partly due to Alpine not using Virtual DOM. However, given that even vanilla JS does not suffer from such issues, could any optimizations be made to how
x-for
is re-rendered?Beta Was this translation helpful? Give feedback.
All reactions