Investigate whether the canvas ring buffer is working well on react-stockcharts
Categories
(Core :: Graphics: Canvas2D, task)
Tracking
()
People
(Reporter: jrmuizel, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
In https://share.firefox.dev/3DdMTVk we spend a small but noticeable amount of time waiting on the main thread for the canvas ring buffer.
Maybe it's possible for us to do better?
Reporter | ||
Comment 1•2 years ago
|
||
Bob, the benchmark is here: https://grandprixbench.netlify.app/?suites=React-Stockcharts. Do you mind taking a look to see if everything is working as well as it could when you get a chance?
Reporter | ||
Updated•2 years ago
|
Comment 2•2 years ago
|
||
Possibly, but it's mainly waiting for DrawTargetD2D1
functions in the GPU process, because if I turn off remote canvas then it is much slower, not far off half the score.
There would be ways of improving that.
Increasing the buffer size might help a bit, but probably not much.
Decoupling the reading from the buffer from the processing, but given this is going to be replaced with the webgl version at some point that seems like a lot of work.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Reporter | ||
Comment 3•2 years ago
|
||
So react-stockcharts has been replaced with chartjs. We block a lot during it as we wait for D2D. Increasing the buffers size makes a big difference especially when I speed up paint on the D2D side.
The current ring buffer is per canvas right?
Comment 4•2 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #3)
So react-stockcharts has been replaced with chartjs. We block a lot during it as we wait for D2D. Increasing the buffers size makes a big difference especially when I speed up paint on the D2D side.
The current ring buffer is per canvas right?
No, the ring buffer is per content process and we clean it up when it hasn't been used for so many frames.
Reporter | ||
Comment 5•2 years ago
|
||
(In reply to Bob Owen (:bobowen) from comment #4)
No, the ring buffer is per content process and we clean it up when it hasn't been used for so many frames.
Where's the code that does this?
Comment 6•2 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #5)
(In reply to Bob Owen (:bobowen) from comment #4)
No, the ring buffer is per content process and we clean it up when it hasn't been used for so many frames.
Where's the code that does this?
I misremembered it's currently actually after 10 seconds (not based on frames):
https://searchfox.org/mozilla-central/rev/3424c000a7ff304b2d1efb8561a924232f7f12fc/gfx/layers/ipc/CompositorBridgeChild.cpp#546
Reporter | ||
Comment 7•2 years ago
|
||
What triggers that code for a backgrounded tabs? It seems like it's only called from EndTranscation().
Comment 8•2 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #7)
What triggers that code for a backgrounded tabs? It seems like it's only called from EndTranscation().
Possibly nothing if that is not called.
I thought that it might be triggered by memory pressure as well, but I think that was some of the other caches.
Is there something else similar for background tabs?
Updated•2 years ago
|
Updated•1 year ago
|
Comment 9•1 year ago
|
||
I guess this has been fixed by recent canvas work, but the link for testing in comment 1 is no longer working.
Comment 10•5 months ago
|
||
A lot has changed on Canvas2D and the ring buffer, so given the original test link no longer works I'm just going to close this.
Comment 11•5 months ago
|
||
There's another link on comment 3 which might be useful for testing.
Comment 12•5 months ago
|
||
(In reply to Marco Castelluccio [:marco] from comment #11)
There's another link on comment 3 which might be useful for testing.
Thanks, in which case I think we can mark this as fixed.
Probably by the same things that fixed bug 1850775.
Description
•