Closed Bug 1381045 Opened 7 years ago Closed 7 years ago

stylo: Significant Tp5 regression between rev 0e41d07a703f and rev b07db5d650b7

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: bholley, Assigned: jdm)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file, 2 obsolete files)

Flags: needinfo?(bobbyholley)
(I suspect the error reporting patch, fwiw)
bz thinks this is likely related to the CSS error reporting. Many tests didn't change at all, but dailymotion got 3.5x slower (which could be explained by a lot of invalid CSS). Confirming with try pushes.
(Note that the second and third links are the same, I just pasted the middle one by accident). Note that "still there" is a bit of an oversimplification, because the memory patch reduces the performance impact considerably. However, there is still a sizeable regression remaining.
Per IRC discussion, we should at the very least duplicate the NonMozillaVendorIdentifier check that Gecko's CSS parser does to avoid error-reporting property names that start with '_' or '-' but not "-moz-". That might eliminate a bunch of the error reporting we're doing right now.
Profiling revealed two hotspots - one is that the UTF-8 -> UTF-16 conversion for the CSS source text is a hot path that dominates the error reporting path (up to 70%). The other is that Stylo currently reports many more errors on dailymotion than Gecko does, which causes us to start dropping previously buffered nsScriptError values while reporting new ones, leading to many deallocations that take up to 30% of the time. A significant source of the extra errors is that Stylo reports unrecognized vendor-prefixed properties as errors, unlike Gecko: http://searchfox.org/mozilla-central/rev/cbd628b085ac809bf5a536109e6288aa91cbdff0/layout/style/nsCSSParser.cpp#7165-7169 . I've filed https://github.com/servo/servo/issues/17736 for the second issue.
If I remove the actual CSS source from the error message, the profiles I get are indistinguishable from the Gecko ones. jryans has agreed that the source line is not actually used anywhere outside of devtools tests, so I'm going to go ahead and pass an empty string instead of real source code.
Flags: needinfo?(josh)
Assignee: nobody → josh
Status: NEW → ASSIGNED
Attached patch Remove CSS source text from parsing errors (obsolete) (deleted) — Splinter Review
Comment on attachment 8886715 [details] [diff] [review] Provide an empty string as the CSS source text in parser errors In the interest of fixing the performance problem ASAP, I'm going to land a more targeted fix and file a followup to finish this patch the right way.
Attachment #8886715 - Attachment is obsolete: true
Attachment #8886715 - Flags: review?(cam)
Blocks: 1381188
bholley gave this r+ over IRC. It is necessary to land after https://github.com/servo/servo/pull/17738 merges to autoland.
Attachment #8886727 - Attachment is obsolete: true
Is there a gecko bug tracking https://github.com/servo/servo/issues/17736 ?
Flags: needinfo?(josh)
Flags: needinfo?(josh)
Pushed by kwierso@gmail.com: https://hg.mozilla.org/integration/autoland/rev/610ba2072434 Remove CSS source text from parsing errors. r=bholley a=bustage
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Blocks: 1381270
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: