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

I don't think that's what OP is saying. They're saying that (e.g.) calculations are made on each appendChild() call when it would be more efficient (when you know you're going to be inserting a ton) to suspend all calculation, insert 1000 nodes, then resume calculations. Something akin to setNeedsLayout() on iOS:

https://developer.apple.com/documentation/uikit/uiview/16226...



I good parallel might be database development, the difference between taking a cursor and looping through to make changes vs a set based operation that understands how to specify all the needed changes at once.


Yes, that's exactly my point, thanks for expressing it better than I could




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

Search: