4 ms·
I'd take it with a grain of salt. - Benchmarks are only for Safari and without good documentation for how they were performed. Measurements are only in
by explorigin 11y ago
I'd take it with a grain of salt.
- Benchmarks are only for Safari and without good documentation for how they
were performed. Measurements are only in the 100ths of seconds where these
measurements should have much more granularity.
- The TodoMVC (arguably the most real-world) benchmark is nearly 50% slower
than virtual-DOM.
- virtual-DOM is fairly mature at this point where as MorphDOM looks very
young.
- virtual DOM implementations allow you to do things like React Native
- striking 11y agoNoted. Meanwhile, this is 12.3kB (uncompressed) while React's core (minus addons or anything) is 121.7kB. For something as young as this, and to do fairly well in a number of benchmarks compared to the highly engineered piece of work that is React is pretty great. This library can only get better. It's great to see someone trying to make a more lightweight React. Also, you can see exactly how the benchmarks are run through the /test folder. My test using PhantomJS gave me the same results as the recorded statistics against Safari. And because it uses the browser's built in DOM toolkit rather than a virtual one, (in theory) it should become faster whenever browser DOMs become faster.
- blablabla123 11y ago> It's great to see someone trying to make a more lightweight React. For sure, also I must say how amazed I am about React's great ecosystem. In only a year a lot of high quality plugins have been created.
- psteeleidem 11y agoOn the following note: > it should become faster whenever browser DOMs become faster The killer feature of React is that it made it possible to efficiently rerender the entire UI and for developers to not have to write code to manually manipulate the DOM. I hope browser vendors take note of this and do more to support this use case. Ideally, morphdom should not even exist and we could instead have the browser natively do the job of diffing/patching the DOM. Admittedly, there would have to be a lot of details to work out, but React, virtual-dom and morphdom are working in the right direction. Behind the scenes, the implementation might change and any good UI framework should make this a non-breaking change.
- explorigin 11y agoAllow me to introduce you to Mithril (http://mithril.js.org/ http://mithril.js.org/), the 18kB (uncompressed) virtual-dom implementation that beats React in many benchmarks. > And because it uses the browser's built in DOM toolkit rather than a virtual one, (in theory) it should become faster whenever browser DOMs become faster. ...as will all virtual-dom implementations get faster as JS becomes faster. I would argue that there is more attention paid to JS-speed than DOM-speed because there is a server-side (among other things).
- psteeleidem 11y agoAuthor of morphdom here. I don't necessarily disagree with anything you said. However, morphdom was designed to be fast enough in situations where you can't or don't want to introduce a virtual DOM. What matters more than a micro benchmark is the performance in a real application and paired with a real UI framework. Would I use morphdom in situations that required rerendering 1000 nodes every 10ms? Probably not. However, it will perform very well in almost most of the typical use cases. There was a lengthy discussion on performance in the following Github issue where I go into more detail on my thoughts: https://github.com/patrick-steele-idem/morphdom/issues/2 https://github.com/patrick-steele-idem/morphdom/issues/2 > virtual-DOM is fairly mature at this point where as MorphDOM looks very young. morphdom is small and focused (about 220 lines of code). It either works or it doesn't and I have a decent amount of test cases to hopefully prove that it works (not to say that it is bug free... the DOM has lots of edge cases in some web browsers). - virtual DOM implementations allow you to do things like React Native This was built for the real DOM. While there can be value in abstractions, this was designed for a web browser.