Closed
Bug 1368665
Opened 7 years ago
Closed 7 years ago
stylo: Consider sorting the class list in the style sharing cache.
Categories
(Core :: CSS Parsing and Computation, enhancement)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
People
(Reporter: emilio, Assigned: bholley)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
2.76 KB,
patch
|
emilio
:
review+
|
Details | Diff | Splinter Review |
We are comparing class names in order right now.
This was suggested by Bobby in https://github.com/servo/servo/pull/17063, but I didn't do it there.
I think we should have some numbers before doing it, because I don't think it's common at all, and I don't think sorting is as cheap as Bobby suggests.
Assignee | ||
Comment 1•7 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #0)
> We are comparing class names in order right now.
>
> This was suggested by Bobby in https://github.com/servo/servo/pull/17063,
> but I didn't do it there.
>
> I think we should have some numbers before doing it, because I don't think
> it's common at all
What numbers, exactly? It seems entirely dependent on whether the page ever uses multiple orderings of the same class list, which is something that can easily occur with dynamic scripts that .toggle() classes, but that would non-trivial to measure for the entire web, especially given the dynamic part.
> I don't think sorting is as cheap as Bobby suggests.
Can you explain why? Sorting small lists happens in-place, and is very cheap as far as I can tell from the stdlib source. I'm totally happy to limit the sort to class lists of <= 5 or so if you're worried about pessimal cases of thousands of classes.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → bobbyholley
Assignee | ||
Comment 2•7 years ago
|
||
MozReview-Commit-ID: 3vsfP5ECzds
Attachment #8872723 -
Flags: review?(emilio+bugs)
Reporter | ||
Updated•7 years ago
|
Attachment #8872723 -
Flags: review?(emilio+bugs) → review+
Assignee | ||
Comment 3•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•