avoid nsIStyledContent QI in RuleProcessorData

RESOLVED FIXED

Status

()

RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: bryner, Assigned: bryner)

Tracking

({perf})

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

13 years ago
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.
(Assignee)

Comment 1

13 years ago
Created attachment 197302 [details] [diff] [review]
patch
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+
(Assignee)

Comment 3

13 years ago
checked in
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.