stylo: Not much ComputedValues sharing going on on github diff page

NEW
Assigned to

Status

()

Core
CSS Parsing and Computation
P1
normal
2 months ago
a month ago

People

(Reporter: bz, Assigned: bz)

Tracking

(Blocks: 1 bug)

53 Branch
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Assignee)

Description

2 months ago
On https://github.com/bholley/gecko/commit/96ecf505adde95240799d285de90a007310f7bda even with the various fixes we've made for bug 1367862 (which help a lot for that page), I'm not getting very good style sharing.  Even in sequential mode.

Specifically, I am seeing about 109k ComputedValues structs allocated for this page, of which 43k are for text and 39k are for other pseudos.  The remaining 27k are for elements.  For comparison, Gecko allocates a total of about 2200 style contexts here.
(Assignee)

Comment 1

2 months ago
> which help a lot for that page

I meant help a lot for the page in bug 1367862.

Just for context, there are 63k actual elements on this page.

To put numbers to the memory usage here, by the way, about:memory claims 244.69 MB used by this page's process, with 135.95 MB unclassified.  With Gecko those numbers are 144.44 MB and 30.34 MB respectively.
(Assignee)

Comment 2

2 months ago
So each line of code has markup that looks like this:

  <tr>
    <td class="blob-num blob-num-addition empty-cell"></td>
    <td id="diff-8b00cd0478f568c67a7c0949894dfa78R32" data-line-number="32" class="blob-num blob-num-addition js-linkable-line-number"></td>
    <td class="blob-code blob-code-addition">
      <button class="btn-link add-line-comment js-add-line-comment js-add-single-line-comment" data-path="third_party/rust/coco/src/epoch/atomic.rs" data-anchor="diff-8b00cd0478f568c67a7c0949894dfa78" data-position="32" data-line="32" type="button" aria-label="Add line comment">
         <svg aria-hidden="true" class="octicon octicon-plus" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M12 9H7v5H5V9H0V7h5V2h2v5h5z"></path></svg>
      </button>
      <span class="blob-code-inner">+<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-en">Atomic</span>&lt;T&gt; {</span>
    </td>
  </tr>

and the page styles have:

  .blob-code-inner::before {
    content:""
  }

which means we can't share style across those blob-code-inners or any of their numerous span descendants.  If I just hack away the pseudo-element check in relations_are_shareable, we immediately drop to ~46K ComputedValues, of which most are text and pseudo-elements, with less than 2K element ComputedValues.

I filed bug 1369952 on sorting out how to make the pseudo-element thing work.
Depends on: 1369952
(Assignee)

Updated

2 months ago
Depends on: 1329361
Assignee: nobody → bzbarsky
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.