Closed Bug 1312701 Opened 8 years ago Closed 2 years ago

painting is much slower on setImmediate demo than Blink


(Core :: Graphics, defect, P3)

49 Branch





(Reporter: ossman, Unassigned)


(Depends on 1 open bug, )


(Whiteboard: gfx-noted)


(1 file)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0
Build ID: 20160919122641

Steps to reproduce:

Call window.postMessage() in order to split up a large job and allow the browser to schedule other things in between. See example here:

This is a very important use case as it is currently the only API that allows splitting up work without throttling it (in contrast with e.g. setTimeout()).

Actual results:

Chrome executes the test in 257 ms, compared to Firefox' 2128 ms on the same system. I.e. it is almost 10x as fast.

Expected results:

The numbers for Chrome and Firefox should at least be of the same magnitude.
Component: Untriaged → DOM
Product: Firefox → Core
Locally I get ~200ms for Chrome and ~800ms for Firefox nightly.
Based on profile Gecko spends most of the time in painting (and I assume postMessage just needs to wait for painting to finish), but would need to also verify child process isn't just waiting for something.
Dispatching/handling 'message' event itself takes ~4%.
tentatively gfx
Component: DOM → Graphics
This testcase takes about 2100ms on Nightly (javascript.options.asyncstack=false), and 2800ms in Chrome. So the issue clearly isn't in postMessage but in whatever is done between the postmessage tasks.
Yea, on my machine the performance timeline shows paints taking 15ms to 25ms on FF50.  Chrome does the paints in less than 1ms.
I'm seeing about the same numbers in Chrome 54 and Firefox 49 here with that test case. Sorry for assuming that postMessage() was to blame.
Ever confirmed: true
Summary: window.postMessage is much slower than WebKit → painting is much slower on setImmediate demo than Blink
Note, the page appears to be using CSS transforms to move the boxes around.  So I don't think its not canvas or anything like that.
Async painting?
Flags: needinfo?(milan)
Whiteboard: gfx-noted
(In reply to Jeff Gilbert [:jgilbert] from comment #8)
> Async painting?

Something like that.
Depends on: paint-fast
Flags: needinfo?(milan)
Priority: -- → P3

It seems this is a lot better now.
I get ~350 ms on Firefox 70 and Nightly 72 and ~250 ms on Chrome 78.

Chrome 55ms, Nightly 56ms

Closed: 2 years ago
Resolution: --- → WORKSFORME

Getting 144ms with Firefox 102 and 110ms with Chrome 103. In the same ballpark, I guess. :)

You need to log in before you can comment on or make changes to this bug.