Closed
Bug 263959
Opened 20 years ago
Closed 20 years ago
[FIX]Reuse CSS scanners, not just CSS parsers
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla1.8alpha5
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
()
Details
(Keywords: perf)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
Details | Diff | Splinter Review |
This comes from the profile in bug 229391. In that profile, we're spending a
good bit of time (comparable to total time spent in painting, basically) in
InitScanner() and ReleaseScanner(), because we have thousands of inline style
rules being set in a row.
The patch coming up makes CSS parsers not actually delete the scanner when they
ReleaseScanner() and makes scanners deal with being reinitialized. It saves us
about 1% of the total time on the testcase in the URL field.
Assignee | ||
Comment 1•20 years ago
|
||
Assignee | ||
Updated•20 years ago
|
Attachment #161824 -
Flags: superreview?(dbaron)
Attachment #161824 -
Flags: review?(dbaron)
Assignee | ||
Updated•20 years ago
|
Keywords: perf
Priority: -- → P2
Summary: Reuse CSS scanners, not just CSS parsers → [FIX]Reuse CSS scanners, not just CSS parsers
Target Milestone: --- → mozilla1.8alpha5
Assignee | ||
Comment 2•20 years ago
|
||
Note to self: the line in nsCSSScanner.h that declares mURI is now:
nsCOMPtr<nsIURI> mURI; // Cached so we know to not refetch mFileName
per grammar nit on irc.
Comment 3•20 years ago
|
||
Comment on attachment 161824 [details] [diff] [review]
Patch
I'm not convinced ClearScanningState deserves to be its own function. It
doesn't really clear all the state, so it doesn't seem useful to callers other
than Init, and there is only one caller.
Also, is there any reason CSSParserImpl::mScanner needs to be a pointer?
Attachment #161824 -
Flags: superreview?(dbaron)
Attachment #161824 -
Flags: superreview+
Attachment #161824 -
Flags: review?(dbaron)
Attachment #161824 -
Flags: review+
Assignee | ||
Comment 4•20 years ago
|
||
Attachment #161824 -
Attachment is obsolete: true
Assignee | ||
Comment 5•20 years ago
|
||
Fixed
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 6•20 years ago
|
||
So, maybe I'm missing something, but it looks like you're never setting
mScannerInited to true.
Assignee | ||
Comment 7•20 years ago
|
||
Good catch. Checked in the fix.
You need to log in
before you can comment on or make changes to this bug.
Description
•