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

Assigned to



CSS Parsing and Computation
2 months ago
a month ago


(Reporter: bz, Assigned: bz)


(Blocks: 1 bug)

53 Branch
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)





2 months ago
On 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.

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.

Comment 2

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

    <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/" 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>
      <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>

and the page styles have:

  .blob-code-inner::before {

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


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.