Due to the asynchronous nature of paintLines method, it might invalidate DOM couple of times and wait for some period of time before completing its job. During the gap, browser runs a "paint" method to update the image. The "paint" operation is an expensive one - in my experiment, it could last as long as 22ms. That said, remove the asynchronous behavior of paintLines method and estimate how it goes with a synchronous paint. This way we might avoid a lot of unnecessary "repaints".
Created attachment 183968 [details] Patch
Comment on attachment 183968 [details] Patch Wouldn't it get stuck on 200 lines 1Mb each?
Comment on attachment 183968 [details] Patch Clearing flags on attachment: 183968 Committed r140427: <http://trac.webkit.org/changeset/140427>
All reviewed patches have been landed. Closing bug.