WebReflection / hyperHTML

A Fast & Light Virtual DOM Alternative
ISC License
3.07k stars 113 forks source link

Very Impressive Library #292

Closed mikeptweet closed 5 years ago

mikeptweet commented 5 years ago

I wonder how it stacks up to https://somebee.github.io/dom-reconciler-bench/index.html in terms of raw performance?

leeoniya commented 5 years ago

it probably makes most sense to have imba submit an implementation to https://github.com/krausest/js-framework-benchmark, where hyperhtml is already ranked on a level playing field:

https://krausest.github.io/js-framework-benchmark/current.html

EDIT:

according to [1] on my PC, imba claims to be 22.26x faster than React, which is literally impossible. React is 1.79x slower than the fastest theoretically-possible implementation.

[1] https://somebee.github.io/dom-reconciler-bench/index.html

WebReflection commented 5 years ago

@leeoniya watch out, the benchmark table you have posted is outdated (and wrong, it uses non keyed hyperHTML but it listed it under keyed)

The updated one is this one: https://stefankrause.net/js-frameworks-benchmark8/table.html

Meanwhile, the core dom/differ changed a lot, and since it's basically a rewritten, non v-dom, based version of petit-dom, it's quite possibly one of the fastest out there.

imba claims to be 22.26x faster than React, which is literally impossible

React is easily one of the slowest in all of my test, up to 20X slower here too: https://webreflection.github.io/clickblaster/

btw, what is imba ? does it use hyperHTML ?

leeoniya commented 5 years ago

the benchmark table you have posted is outdated

i don't think so. the continually updated one is https://krausest.github.io/js-framework-benchmark/current.html, which currently has ivi-v0.16.0 whereas round 8 you're linking still has ivi-v0.15.0.

clickblaster is also a very contrived benchmark. react is also likely slower in part because of its synthetic events. sure, i would not use react's events for mousemove & setState. but in 99.9% of typical use cases, event handling speed will not be anywhere on a performance flame chart if you were to begin optimizing performance of a typical react app.

WebReflection commented 5 years ago

@leeoniya if the library version matters there, then hyperHTML is v2.17.0 so that version is jurassic.

Yet I don't understand what are you doing here ... advertising this imba I've no idea what is about?

Convincing me every bench where React is slower than hyperHTML is because the bench is unfair for React?

How are your posts helping the OP in your opinion?

leeoniya commented 5 years ago

i'm saying that imba's metrics are built to favor imba, and clickblaster is built to favor hyperHTML. js-frameworks-benchmark favors no one.

advertising this imba

wait, what? imba was mentioned by the OP. i simply pointed out that their benchmarks are crappy and that React is not 22x slower. i'm not advertising React either (i don't use it).

How are your posts helping the OP in your opinion?

by advising not to trust each individual framework's own benchmarks. they are all as biased as they come.

WebReflection commented 5 years ago

@leeoniya how is click blaster favoring hyperHTML, exactly ? It explicitly tests sparse updates per multiple clicks. hyperHTML does sparse DOM updates in one click, Neverland and others need more updates per click, React adds to the more updates per click its extra logic.

This is one part of the scenario while js-frameworks-benchmark favors others, like appending 10000 nodes at once which has made petit-dom create those scenarios to win these not really real-world concerns/operations.

It is more complete, yet it tests simply other things where one framework or another might be overall better than others.

WebReflection commented 5 years ago

@mikeptweet I have written a todo mvc long long time ago https://webreflection.github.io/hypermvc/index.html and I'm tired of re-writing every now and then the exact same use case so I have zero interest in implementing yet another TODO thing in hyperHTML but I'd be happy to guide you if interested in doing so.

There's nothing else to do (oh, the irony) here so I'll close this.