Closed rniwa closed 7 months ago
The issue here seems to be that the entire todo list is re-generated each time any checkbox is toggled. So we need to execute querySelectorAll
in each iteration, or update jQuery implementation to not nuke the whole list each time any todo item's completeness is toggled.
we had several prs closed for jQuery, both would address the whole list re-render issue:
https://github.com/WebKit/Speedometer/pull/133
https://github.com/WebKit/Speedometer/pull/140
comment from me from the last example: "The main difference, which I think is beneficial, is the fact that this implementation doesn't re-render the whole list with every update, which is an optimization that other frameworks / libraries do out of the box."
Happy to take a look at both and open a pr for an updated version!
Another possibility would be to use getElementsByClassName which is a live collection. This might change the performance characteristics of the workload though.
Another possibility would be to use getElementsByClassName which is a live collection. This might change the performance characteristics of the workload though.
Yeah, that's another alternative. I'd be happy with either approach.
I can take another look at my previous ones and open a new pr for opinions? Should be able to do that later today if that works.
At this point, my preference is to take a change like #366 as opposed to a broader refactor to optimize re-renders. I'd like to make an as-narrow-as-possible-correctness-fix for 3.0, and to consider whether we should make a refactor for a future version.
Step through jQuery suite in https://speedometer-preview.netlify.app/interactiverunner?suite=TodoMVC-jQuery
We observe that the only first item is marked as completed in "CompletingAllItems" test.