4 ms·
Some feedback: I clicked through to Mithril, saw "Virtual DOM diffing" and thought, oh cool, immutable DOM is awesome (I use React). My next question was, why w
by dustingetz 13y ago
Some feedback: I clicked through to Mithril, saw "Virtual DOM diffing" and thought, oh cool, immutable DOM is awesome (I use React). My next question was, why would anyone choose this over React? I clicked around a little bit but couldn't figure that out from the site.
- rraval 13y agoThe "Performance" section of the linked page claims that Mithril takes 9.44ms where React takes 79.65ms for their rendering benchmark [1] [2]. If true, it could be a good enough reason to pick over React. [1] http://lhorie.github.io/mithril/comparisons/mithril.rendering.html http://lhorie.github.io/mithril/comparisons/mithril.renderin... [2] http://lhorie.github.io/mithril/comparisons/react.rendering.html http://lhorie.github.io/mithril/comparisons/react.rendering....
- lhorie 13y agoI put a performance comparison for React on the homepage yesterday (the link takes you to the actual test page so you can run it yourself). It simply measures running js time for initial rendering, which is the ugly, unavoidable cost of frameworks that authors don't like to talk about. The numbers are mostly averages, but should give a reasonable idea of what is faster than what. I also do go more in depth here ( http://lhorie.github.io/mithril/comparison.html http://lhorie.github.io/mithril/comparison.html ). TL;DR: The main differences is that Mithril is a lightweight MVC, whereas React is a powerhouse at doing only the "V" part. There's actually a project that uses React to enable HTML-y Mithril templates here ( https://github.com/insin/msx https://github.com/insin/msx ), so the two can certainly coexist. Mithril's light weight is mostly a result of picking a very small set of tools that are simple but useful on their own, but that also happen to come together nicely and that can play ball w/ Javascript's FP capabilities and the JS ecosystem as a whole. Mithril is also a bit of a experiment in making a framework that gets out of your way - more hacking and less figuring out what is the syntax to do X. If that's your cup of tea, I'd recommend checking out the blog that I just started last week ( http://lhorie.github.io/mithril-blog/ http://lhorie.github.io/mithril-blog/ ), where I talk about reusable programming techniques.