Note: There are a few cases of duplicates in user autocompletion which are being worked on.

stylo: Parse performance regression from CSS error reporting on

(NeedInfo from)



CSS Parsing and Computation
6 days ago
a day ago


(Reporter: bholley, Unassigned, NeedInfo)


(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)


Bug 1381045 handled the lion's share of the parse performance regression:,dd55da63ebce86ee3867aa3b39975c2a90869ce2,1,1%5D&selected=%5Bmozilla-central,dd55da63ebce86ee3867aa3b39975c2a90869ce2,227622,298192965,1%5D

However, if you look at the test breakdown, is still significantly slower:

Loading the talos testcase for, I get the following profiles:

So parsing is definitely slower, and Stylo definitely spends more time reporting CSS errors than Servo does. It's not clear to me whether that accounts for the entirety of the regression, but it's probably a good place to start.
Flags: needinfo?(josh)
Are those profiles done at 0.5ms sampling interval?  I ask because all the times seem to be multiples of 0.5.

It sort of matters because I see 0.5ms spent under GetStringFromName in the Gecko profile and 2.0ms under FormatStringFromName in the servo profile instead, but if that's 1 vs 4 samples it could just be random...

For the rest, we should certainly fix bug 1381195 and see how that affects things: right now stylo simply reports way more errors than Gecko does, esp. on sites using lots of -webkit- properties, and I bet does that.
Depends on: 1381195


6 days ago
Flags: needinfo?(bobbyholley)
(In reply to Boris Zbarsky [:bz] from comment #1)
> Are those profiles done at 0.5ms sampling interval?  I ask because all the
> times seem to be multiples of 0.5.

Flags: needinfo?(bobbyholley)
I filed bug 1381282 on the NS_NewURI calls during error reporting in those profiles.
Priority: -- → P2
In my local testing after bug 1381195, I see Gecko taking 2-3ms for reporting errors when loading the page, and Stylo dropped from 7ms to 3ms.
Flags: needinfo?(josh)
I still see a ~10 ms regression with the fix in bug 1381195:

Can you have a look and see what accounts for it?
Flags: needinfo?(josh)
I made profiles of two builds: one with all of geckolib::error_reporter::ErrorReporter::report_error commented out one with with that code enabled. This means that I can see the impact of the actual integration with the console service, and infer that the remaining difference is due to the extra error data that is now being passed around the CSS parser. Unfortunately, I don't have a lot of confidence in the numbers I'm getting from the profiler - the difference between the two builds is ~10ms, but the amount of time spent under ErrorReporter::report_error only amounts to ~5ms of that. I'm finding it really difficult to figure out the next step here, but I've submitted which did improve the numbers I was seeing; let's take another look at talos after it merges.
Oh good, the more runs I do, the worse the results get:

I'll try digging into myspace, since I'm out of ideas for
You need to log in before you can comment on or make changes to this bug.