Closed Bug 1371061 Opened 5 years ago Closed 5 years ago
Base Hashtable::Get Or Insert does two hashtable lookups in the Insert case
http://searchfox.org/mozilla-central/rev/1a054419976437d0778a2b89be1b00207a744e94/xpcom/ds/nsBaseHashtable.h#126,131 This is bad for performance obviously.
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 firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/97735d7197e2 Optimize nsBaseHashtable::GetOrInsert() to only do a single hashtable lookup. r=froydnj
You need to log in before you can comment on or make changes to this bug.