React Hooks misleading benchmark ?
See original GitHub issueIāve been testing neverland against React, as itās fully inspired by its hooks concept. However, if you remove the key={item.id}
assignment from this row, to make it non-keyed, the benchmark runs fine only because the removed rows are decreasing, but never increasing.
If you just drop that key
and you build-prod
and try to remove twice the same row, or row 2 then row 4, youāll have the whole benchmark/browser stuck forever because the logic is incapable to deal with such scenario.
Accordingly, since I believe React with hooks doesnāt require mandatory keyed transforms, and apologies if it does as I wasnāt aware of it, the current benchmark is misleading, as the same code, or similar up to the keyed point, cannot be used in non-keyed scenarios.
I am not sure this means React with hooks result should be invalidated, as it actually works well when keyed rows are used, but I think Iāve found a glitch in this benchmark suite, as the removal of rows should rather be both for the previous row, but also for the row after, to bail out all frameworks incapable of dealing with real-world scenarios, instead of having facilitated only the ādrop previous rowā one, which is currently the case.
Please let me know if youād like me to file a PR that change the current row removal benchmark, or penalize keyed tests that wouldnāt work once non-keyed, or even ignore this issue, as considered not relevant for the current results.
Thank you.
Issue Analytics
- State:
- Created 4 years ago
- Comments:27 (26 by maintainers)
Top GitHub Comments
Of course your work has been very influential on the Web Component side of things. I was just mentioning that many Virtual DOM libraries werenāt as good as they were today. Your libraries have always been at the forefront for Web Components in my mind and I have a lot of respect for your work. Which is why I was so curious about your thoughts on these nagging details of keyed/non-keyed.
@krausest I still think having the change in the remove bench would help revealing other gotchas:
it adds not much time to execute that test, but it helps understanding implementations