Closed Bug 537290 Opened 10 years ago Closed 10 years ago

Reduce uses of aNode.localName, namespaceURI in XPath generation

Categories

(Firefox :: Session Restore, defect)

defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 3.7a1

People

(Reporter: zpao, Assigned: zpao)

References

(Blocks 1 open bug)

Details

(Whiteboard: [tsnap])

Attachments

(1 file)

These hit "various XPConnect slow paths due to the cross-origin access" - bz in bug 536910 comment #29

We access these each iteration in a loop (counting sibling nodes) and once before even getting in the loop. We can take bring that down to 1 total per node (I don't think we can get rid accessing these in the sibling nodes).
Attached patch Patch v0.1Splinter Review
I didn't move the assignment of nName up because we don't need to access it if the node has an ID, so it wasn't worth moving it up for slightly better looking code.
Attachment #419587 - Flags: review?(zeniko)
Attachment #419587 - Flags: review?(zeniko) → review+
FWIW, Boris profiled with the test case in bug 536910 after this patch. We dropped from 24000 samples to 17500 samples (which is ~27% (or .11 seconds) savings).
Pushed http://hg.mozilla.org/mozilla-central/rev/ae840f673072
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.7a1
What can QA do to verify this bug?
If things didn't break, we're good.
(In reply to comment #5)
> If things didn't break, we're good.

Good enough!  Marking verified.
Status: RESOLVED → VERIFIED
Blocks: 558645
You need to log in before you can comment on or make changes to this bug.