luwes / js-diff-benchmark

Simple benchmark for testing your DOM diffing algorithm.
66 stars 5 forks source link

Improve operations count to reflect real world DOM mutations #25

Closed WebReflection closed 4 years ago

WebReflection commented 4 years ago

As discussed in https://github.com/luwes/js-diff-benchmark/issues/7#issuecomment-615875584, the way we are counting operations does not reflect the real-wolrd amount of DOM mutations triggered through the nodes:

Accordingly, the counting should change too, specially the swap and the shuffle, as most libraries technically trigger similar amount of observable mutations on the tree:

The table better reasons, and explain, why udomdiff performs similarly, if not faster, than other libraries when it comes to the shuffling example

Screenshot from 2020-04-18 16-11-51

WebReflection commented 4 years ago

P.S. the proof for mutations happening even if a node doesn't leave the tree is here https://github.com/luwes/js-diff-benchmark/issues/7#issuecomment-615652697

WebReflection commented 4 years ago

Following the table using the before element:

Screenshot from 2020-04-18 16-29-28

WebReflection commented 4 years ago

feel free to merge too, I added you as a collaborator.

I know, but I'm used to have other people eyes on my PR when it's more than just me on a repo 😉