WebKit / Speedometer

An open source repository for the Speedometer benchmark
Other
592 stars 70 forks source link

jQuery test only ever marks the first todo item as completed #365

Closed rniwa closed 7 months ago

rniwa commented 7 months ago

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.

rniwa commented 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.

flashdesignory commented 7 months ago

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!

julienw commented 7 months ago

Another possibility would be to use getElementsByClassName which is a live collection. This might change the performance characteristics of the workload though.

rniwa commented 7 months ago

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.

flashdesignory commented 7 months ago

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.

bgrins commented 7 months ago

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.