Large amount of time spent in texture_pack::guillotine::GuillotineAllocator::allocate
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
People
(Reporter: jrmuizel, Assigned: nical)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
From https://codepen.io/noahblon/pen/wEfCz
https://share.firefox.dev/3xMOfCC
Runs much better in Chrome
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
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.
Assignee | ||
Comment 2•3 years ago
|
||
- 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.
Updated•3 years ago
|
Comment 4•3 years ago
|
||
bugherder |
Comment 5•3 years ago
•
|
||
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.
Description
•