|
|
|
|
|
by ghostdiver
4697 days ago
|
|
I have same feeling, Making single frame of JS code to run fast is cool and dandy, but eventually browser will have to make freeze and do reflow+repaint.
Eventually it will make profiling harder, think about caching .offsetHeight etc. properties. It does decrease script execution time, but it does not make your app to work faster. |
|
if you do something like
If you have code like the above, it is going to cause a repaint on each iteration. If you unroll it into three separate loops, one that does dom modification, one that does dom measurement, and another that does modification, then you will drop the number of repaints from potentially 100s to just 2.