Open Bug 1813423 Opened 2 years ago Updated 7 months ago

A Js/Canvas demo spends 15+ seconds in cc

Categories

(Core :: Cycle Collector, enhancement)

enhancement

Tracking

()

People

(Reporter: mayankleoboy1, Unassigned)

References

()

Details

Optional prerequisite: Enable the gpu-canvas feature to eliminate Canvas as the major source of slowness while animating the demo.
Go to https://www.fxhash.xyz/generative/slug/boundless-realm-of-possibilities
Click on "Open". The demo will run. Enjoy it.
Press the "a" button on your keyboard. The demo will animate

ER The animation will take a long time to complete (specially the black boxes on the bottom row of the image will take a long time to get colored.)
Profile suggests long time in cc/gc : https://share.firefox.dev/3Y370y9

Optional profile with d2d-canvas: https://share.firefox.dev/3wFjf7S

Chrome also appears to continuously use CPU here.. Which seems to suggest that the demo is doing something weird.

Depends on: 1813437

Something about this demo is causing Firefox to leak contexts used to paint on HTML canvases. Or at least to churn through them faster than the cycle collector can recover them. According to the profile it's spending 18% of its time in HTMLElementCanvas::getContext and another 18% in HTMLElementCanvas::Release() during CC.

Component: XPCOM → Cycle Collector

Similar to bug 1811188 where someone is basically writing bad code - creating tons of ImageData objects, among other things.

Profile with latest Nightly: https://share.firefox.dev/3RoOQEh

See Also: → 1811188

The behaviour has now changed.

Previously, memory would rise slowly and around the 1GB mark, the long CC would start. I dont recall if the memory would increase after the CC completed.

Now, the memory rises continuously and rapidly (50mb/s). Profile: https://share.firefox.dev/3Wt4ClH

Bisection:
Bug 1857618 - Ensure normal tasks get enough time to run, r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D193409

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