Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But then render() has to re-generate all the stuff over and over again, which could be slow.


There are two things that stop it from being slow in practice:

1. The virtual DOM that render deals with is several orders of magnitude faster than the real DOM, so you need to have thousands of elements before it starts taking longer than making the one change to the real DOM for the one element that changed

2. You can skip calling render on subcomponents that haven't changed, so while updating a list of 10000 elements where one has changed would require iterating through 10000 elements, updating a list of 100 elements that each contains 100 elements where one of the bottom level elements has changed would only require iterating through 200 elements.


Right, this is where you need to look at benchmarks http://swannodette.github.io/2013/12/17/the-future-of-javasc...




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

Search: