Open Bug 1396874 Opened 7 years ago Updated 2 years ago

stylo: Investigate why PropertyDeclarationBlock::get is (can be?) slower than nsCSSCompressedDataBlock::ValueFor

Categories

(Core :: CSS Parsing and Computation, enhancement, P4)

53 Branch
enhancement

Tracking

()

Tracking Status
firefox57 --- wontfix
firefox58 --- wontfix
firefox59 --- ?

People

(Reporter: bzbarsky, Unassigned)

Details

Fundamentally these should be doing very similar things: walk an array of (property id, value) pairs and get the value.  But in bug 1355599 we have:

>* 14 samples in nsCSSCompressedDataBlock::ValueFor vs 35 samples in PropertyDeclarationBlock::get

and it might be worthwhile to check why.  What do the actual data representations end up looking like, for example?  Are we doing extra branches or pointer-chases in PropertyDeclarationBlock::get?

For scale, I believe those numbers correspond to 1.4ns and 3.5ns per call respectively, so we're talking tiny numbers of instructions here.  If it turns out that the difference is due to PropertyDeclarationBlock being optimized for some particular use that's hotter than get(), that would be enough reason to do nothing.  But it seems like property lookup in a PropertyDeclarationBlock would be a pretty common operation on that data structure.
Oh, and priority wise this is definitely in the "post-ship optimization" bucket.
Priority: -- → P4
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.