Right, the DOM is a shitshow, I'm not gonna say that JavaScript itself isn't, but it is a faster shitshow than most people know. Your example still sounds slow, but it is not completely beyond the expected. If you want I'll give you some pointers to avoid the worst of it.
-
-
And if I try to regress it all the way back to the original code that I started with, although I'm not 100% sure exactly what that looked like, it takes 2.67s/50ms. So at least as far as I can tell, the recalc time is always constant.
-
It's just how inefficiently you go about setting things. If you set a bunch of styles and look up elements poorly, and/or make function calls instead of not, etc., you can make the JavaScript take longer and longer but it's not because of the recalc.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.