luwes / js-diff-benchmark

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

Add spect forward implementation #26

Closed dy closed 4 years ago

dy commented 4 years ago

Ok, this adds forward spect implementation, 218b.

It is the slowest among others (due to create/append metrics slowdown), but the reason is, I suspect, suboptimal Dommy nextSibling implementation. The real DOM demonstrates digits, comparable with direct appendChild: image. (another possible reason - some intrinsic v8 optimizations for some algos - not going to chase that way))

WebReflection commented 4 years ago

all libraries are using nextSibling, the Dommy cost is linear across implementations, right?

It'd be great to see how you're testing the real DOM though, as I think we'd like to do that too for all libraries.

WebReflection commented 4 years ago

Merged, current status:

Screenshot from 2020-04-18 16-42-01

dy commented 4 years ago

@WebReflection it's pretty straightforward: https://github.com/spectjs/spect/blob/h-reducers/test/diff.js#L452-L481