Closed Bug 309927 Opened 19 years ago Closed 19 years ago

avoid nsIStyledContent QI in RuleProcessorData

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

Details

(Keywords: perf)

Attachments

(1 file)

We can save on the cost of AddRef and Release by using IsContentOfType instead 
of QI'ing to nsIStyledContent.  nsIStyledContent is implemented only by 
content of type ELEMENT, so if that succeeds, we can just cast.  Speeds up 
RuleProcessorData ctor by about 8% according to quantify.
Attached patch patchSplinter Review
Attachment #197302 - Flags: superreview?(dbaron)
Attachment #197302 - Flags: review?(dbaron)
Comment on attachment 197302 [details] [diff] [review]
patch

r+sr=dbaron if you add an assertion in the constructor, outside the if, that
nsCOMPtr<nsIStyledContent>(do_QueryInterface(aContent)) == mStyledContent.
Attachment #197302 - Flags: superreview?(dbaron)
Attachment #197302 - Flags: superreview+
Attachment #197302 - Flags: review?(dbaron)
Attachment #197302 - Flags: review+
checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: