I am actually pretty experienced with JavaScript :) Like I said, I optimized it just fine, and it's OK now. Unfortunately the browser can't really handle 16k DOM objects so it's unclear that I won't have to switch to canvases anyway, but that's a separate issue.
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.
-
That said, in capturing those perfs I did see a disturbing amount of variability across runs of the same page/script in Chrome :( So one significant caveat here might be that I guess I don't know if Chrome has some bad bugs in here that are making these perf results suspect?
- 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.