Canvas demo can spend 13s in HTMLCanvasElementObserver::UnregisterObserverEvents() (4m+ in extreme case)
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
People
(Reporter: mayankleoboy1, Unassigned)
References
()
Details
Attachments
(2 files)
- Go to https://ondras.github.io/primitive.js/
- Select the attached image file as the input
- Set the box (3rd column, 2 row) slider to maximum value - 1000
Extreme 3. (For the "extreme" version, do the above and then set the first slider to maximum value - 500) - Click "Lets Go"
AR:
Extreme version: https://share.firefox.dev/3T0sGJF
Normal version (skia-canvas): https://share.firefox.dev/48Nao4M
Normal version (gpu-canvas): https://share.firefox.dev/3TkYhXZ
ER: Maybe something to improve?
(This sounds like it may be bug 1870765 and thus may end up being a dupe.)
cc smaug and continuation
Can repro on a build from Jan2022, so not a recent regression
Reporter | ||
Comment 1•1 year ago
|
||
Reporter | ||
Comment 2•1 year ago
|
||
Reporter | ||
Updated•1 year ago
|
Comment 3•1 year ago
|
||
It looks like the time is all under HTMLCanvasElementObserver::UnregisterObserverEvents(). The cycle collector itself can't do anything about it. I'm guessing there's quadratic behavior in that code somehow.
Comment 4•1 year ago
|
||
Is there a lot of canvas objects? Removing the observer removes from an unordered list so it could be quadratic. We had a similar problem with ImageBitmaps, so we just used a hastset to keep track of imagebitmaps that observed shutdown.
Comment 5•1 year ago
|
||
Yeah, I see 116000 calls to HTMLCanvasElementObserver::UnregisterObserverEvents.
Comment 6•1 year ago
|
||
Triage - rating as S3, if this appears on websites that aren't merely demos I would consider S2.
Reporter | ||
Comment 7•1 year ago
•
|
||
With gpu-canvas, this also manifests as a "system-level" exponential increase in memory use that will OOM the browser/machine.
Example profile : https://share.firefox.dev/48SgsZw (system-level memory was about 10GB from a baseline of 5.5GB)
Description
•