Hacker News new | past | comments | ask | show | jobs | submit login

For the life of me, I can't understand why there is so much emphasis on the virtual-dom and dirty checking.

DOM manipulation is expensive, so a check is made to see if it really needs to be done.

If you're guaranteed to need an update, then this check is pointless. But this depends on what you're doing. Its really not something that's tied to the technical identity of any library. React, vue, etc, could probably also skip this step if they wanted.

Also, this will almost never be the bottle neck. It's really low down on a long list of other things that will have a bigger impact. Web dev is in a really bad state - you're supposed to have something like 1.5k nodes according to lighthouse because of all junk that browsers have to do now. That's a puny number of checks for the cpu to do.




The problem is more in the huge number of renders react does if you don’t do everything perfectly. In a large application it gets steadily slower.


IME the Virtual DOM approach is not bad per se -- I appreciate that I can just instruct the library what final state I want and it figures out the details. It's just that for various reasons the algorithms used for "should we update this DOM node" don't scale well.

Of course, if everything was done perfectly I'd imagine an 80486 CPU should be able to render most of today's websites in 0.5 secs but... it's not done perfectly. :)

I like Svelte quite a lot, and I like the idea of the OP's library as well but I wouldn't count React dead just yet. It has a really good idea and the general ergonomics are there. But we shouldn't deny that it still has a room for improvement.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: