luwes / js-diff-benchmark

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

Give weight to DOM mutations (in addition to pure algo) #13

Closed luwes closed 4 years ago

luwes commented 4 years ago

The test at the moment measures the algorithm but it doesn't correlate to real life where the number of DOM mutations can have a bigger impact than the algorithmic logic.

It would be interesting to see if giving weight (take more time) to these operations could simulate a real browser environment better.

Probably better start using playwright or puppeteer at that point https://github.com/puppeteer/puppeteer https://github.com/microsoft/playwright

WebReflection commented 4 years ago

it feels like we're going to re-implement js-framework-benchmark after all ... 😉

luwes commented 4 years ago

you're right, it's great it's a fast test at the moment. don't want to slow it down much. the weights might be something tough. stage0 is consistently the lowest in operations for the shuffle, I think it should give some benefit at least.

WebReflection commented 4 years ago

again, if it takes "forever" to figure out the least amount of operations, you can't win. I've used Levenshtein distance, the Meyer's O(ND), and these all look good on paper, but perform kinda poorly on DOM.

I agree that having real DOM engines in the mix makes sense, but I wouldn't expect concrete changes in numbers.