localvoid / uibench

UI Benchmark
183 stars 20 forks source link

Add DIO.js #2

Closed thysultan closed 7 years ago

localvoid commented 7 years ago

Dio.js doesn't support "track by keys" algo, and "shouldComponentUpdate" optimization? Almost all other implementations implemented with "track by keys" and "sCU"(+components overhead).

thysultan commented 7 years ago

@localvoid There is support for "shouldComponentUpdate" optimizations and keys but it have not added them to the implementation, would "shouldComponentUpdate" make much of a different in this case?

localvoid commented 7 years ago

By default this benchmark is running in "sCU enabled" mode, and when it pushes new state, it preserves identity of objects that haven't changed, so simple identity check oldProps !== newProps should work. In some cases it will make a huge difference :) I've added this because many people criticized vdom-benchmark because it didn't have "sCU", but I agree that it doesn't give any useful information for ui library developers.

I am usually interested in Components overhead (many megamorphic lifecycle hook invocations), because most of the other implementations have "sCU" in Components. And when someone doesn't have components, I just add in comments that it doesn't have components overhead.

thysultan commented 7 years ago

@localvoid I changed the pure functions to components. Q: What does tree/[2,2,2,2,2,2,2,2,2,2]/removeAll do?

localvoid commented 7 years ago

Removes 2 top-level nodes in a deeply nested tree: 2 nodes at top-level, each top-level node have 2 children, etc(10 levels deep).