Closed Bug 1744052 Opened 3 years ago Closed 3 years ago

Large amount of time spent in texture_pack::guillotine::GuillotineAllocator::allocate

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

VERIFIED FIXED
97 Branch
Tracking Status
firefox97 --- verified
firefox98 --- verified

People

(Reporter: jrmuizel, Assigned: nical)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Flags: needinfo?(nical.bugzilla)
Blocks: wr-perf
Severity: -- → S3

The guillotine allocator stores the free rectangles three bins (by size) to speed up the search, but it looks like the bin sizes are tiny (1, 16, 32px, probably leftover from a distant past when this allocator was used for glyphs), so I suspect that all render tasks end up in the same bin. It would be useful to gather some rough stats about render task sizes and fix the bins accordingly.

If that's not enough we could consider a different data structure when the number of items is high.

Blocks: wr-frame-building-perf
No longer blocks: wr-perf
Flags: needinfo?(nical.bugzilla)
  • Store the free rect sizes with fewer bits in a spearate array to scan it faster (the bulk of the optimization is here)
  • Round up the allocation sizes to reduce fragmentation a bit
  • Remove the dead best-area-fit code, we can resurrect it later if need be.

With this patch the, the guillotine allocator almsot disappears from the profile.

Assignee: nobody → nical.bugzilla
Status: NEW → ASSIGNED
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7a2debb638b4 Speed up the guillotine allocator. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch

Reproduced the issue on Firefox 96.0a1 (2021-12-02) under macOS 11.6.2 by using the link provided in Comment 0.

The performance is improved on Firefox 97.0b9 and Nightly 98.0a1 (2022-01-30). Tests were performed on macOS 11.6.2, Windows 11 and Ubuntu 20.04.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: