Closed Bug 1785673 Opened 2 years ago Closed 2 years ago

Improve DisplayListPayload preallocations

Categories

(Core :: Graphics, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Observed in bug 1784940 and https://share.firefox.dev/3zX823M. Most of the jank was due to the font locks, but a sizeable amount of the profile was spent reallocating each frame. It is probably because the maximum size for the DisplayListPayload preallocations is too small.

I think we can try to fallibly allocate the same size buffers as before. If we fail, then just start with empty preallocations. Better to fail later on the sizes we actually end up needing to paint the display list. If there is memory pressure, or if we move away from the tab, we will get cleared anyways.

Instead of setting a ceiling on how much we are willing to allocate, we
should always try to reallocate a buffer the same size that we used
before. If we cannot, we should fail gracefully and just not preallocate
at all. This should help with profiles where we consistently need a
larger payload buffer than the previous maximum, while minimizing OOM
crashes on the other side, where our preallocations fail and/or are more
than the next display list update actually requires.

This will signature shift those annotated in bug 1531819 to other areas.

Blocks: 1531819
Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/043aa3c3008d
Improve DisplayListPayload buffer preallocations. r=nical
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: