4 ms·
Meh. I'm fed up of spending hours trying to squeeze performance out of Angular's directives system without breaking existing code, when there are so many undocu
by lhorie 13y ago
Meh. I'm fed up of spending hours trying to squeeze performance out of Angular's directives system without breaking existing code, when there are so many undocumented caveats, pitfalls, and subtle semantic differences between this or that solution.
The issue of too many bindings he mentioned is a real one, and the complexity of this solution in general shows what sort of hoops you end up having to go through to get the basic stuff working (i.e. a for loop).
This is part of the reason why I wrote Mithril ( http://lhorie.github.io/mithril http://lhorie.github.io/mithril ) and the main factor for why I am planning on replacing Angular altogether for our mission critical app at work.
- dustingetz 13y agoSome 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.
- carsongross 13y agoIf you are willing to consider a different direction entirely, I'm working on a little library for simple, declarative AJAX: http://intercoolerjs.org/ http://intercoolerjs.org/ We do away with the client side model and complexity entirely and use partial HTML updates to get a better UX. It isn't right for everything, but it is orders of magnitude simpler than Angular and it allows you to reuse many of the perf tuning tools we've developed over the last decade of web development.
- quest88 13y agoInstead of contributing something to Angular's GH repo that would help your problems, or even creating a branch that's an angular-optimized branch, you create a whole new project. Why?
- TY 13y agoMithril looks very interesting - added to my research list. I've skimmed through the docs and couldn't see the list of supported browsers - can you please advise? Also, have you considered adding an entry to ToDoMVC project [1] for ease of comparison to other frameworks? I know it's not an exciting endeavour but it does make comparison much easier. Thank you for creating it and your time in advance. [1] https://github.com/tastejs/todomvc https://github.com/tastejs/todomvc
- lhorie 13y agoYou should be able to support all the way back to IE6 and Blackberry, although you need to include a few polyfills ( http://lhorie.github.io/mithril/tools.html http://lhorie.github.io/mithril/tools.html ) Re: TodoMVC - there was someone working on an implementation here: https://github.com/jpmonette/todomvc-mithril https://github.com/jpmonette/todomvc-mithril I think it's not fully implemented yet, but you should be able to see the general look and feel of the code.
- littleiffel 13y agoMithril looks very nice. I will look into that and see what happens in there. I understand your frustrations with AngularJs, I went through them as well, but still think that AngularJs is a great framework as BackboneJs and EmberJs and it has its strength and weaknesses.