Closed Bug 1371061 Opened 2 years ago Closed 2 years ago

nsBaseHashtable::GetOrInsert does two hashtable lookups in the Insert case

Categories

(Core :: XPCOM, defect, major)

defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: mats, Assigned: mats)

References

Details

(Keywords: perf, Whiteboard: [qf:p1])

Attachments

(1 file)

It seems to me we could just do a PutEntry instead:
http://searchfox.org/mozilla-central/rev/1a054419976437d0778a2b89be1b00207a744e94/xpcom/ds/nsTHashtable.h#147
Assignee: nobody → mats
Thanks for fixing this.  I didn't push very hard in the initial bug to do the Right Thing, but I see now that it wouldn't have been very hard to do the Right Thing, which is completely my fault!
Try looks green so far so I think it'll pass.
Attachment #8875526 - Flags: review?(nfroyd)
Attachment #8875526 - Flags: review?(nfroyd) → review+
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/97735d7197e2
Optimize nsBaseHashtable::GetOrInsert() to only do a single hashtable lookup.  r=froydnj
Whiteboard: [qf] → [qf:p1]
https://hg.mozilla.org/mozilla-central/rev/97735d7197e2
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.