stowball/Layout-Engine

Reflow / repaint slow

herbalite opened this issue · 2 comments

I've found that this is an helpful script, However it slows down loading times for a page.

The issue seems because .className gets updated incremental during execution.

Here a link on why this reflow will happen

http://dev.opera.com/articles/view/efficient-javascript/?page=3#reflow

So may I ask you to consider changing the code, that className will be set once, and once only?

Thank you.

Thanks heaps for logging this issue. It didn't really occur to me that up to 3 DOM modifications would be much worse than 1. It's now fixed in v0.8.0.

To see the performance gains, check: http://jsperf.com/layoutengine-0-8-vs-0-7

Thanks a lot.