Open Bug 2088446 Opened 11 days ago Updated 8 days ago

Investigate better design for nsPresArena.

Categories

(Core :: Layout, enhancement)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 2 open bugs)

Details

Attachments

(1 external file)

Bug 2086477 and the other regressions from bug 2083301 end up basically on the same "we scatter frames around". The sorting helps a bit for common patterns like speedometer (bug 2085386) because the content shapes are similar.

I looked around a bit, and https://docs.webkit.org/Deep%20Dive/Libpas/Libpas.html has a similar feature to what we want called IsoHeaps we might be able to borrow ideas from. AFAICT by doing something like keeping per-type-pages:

  • We reduce significantly the fragmentation / scattered memory.
  • We would be able to decommit memory (rather than keeping it always around) which is nice.

Filing to experiment with this.

This refactors the process-global pres arenas to achieve the following
goals:

  • No unbounded memory growth: Pages can be decommitted now, while still
    reserved so that they don't get reused by other types. Note that we
    still keep slab metadata around, but those are much smaller
    allocations.

  • Better memory locality: Superblocks store a bunch of slabs, which are
    close together, but can be used for different types each. Each slab
    is only used for a single type over its lifetime, but this achieves
    better memory locality between objects of the same type (before that
    we relied on the allocation order).

The design is similar to LibPAS IsoHeaps. This is a decent speedometer
improvement and addresses some of the microbenchmark regressions that
we've seen from making the nsPresArenas process-global.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: