Closed Bug 1372014 Opened 7 years ago Closed 7 years ago

nsWebBrowserPersist::MakeAndStoreLocalFilenameInURIMap does unnecessary hashtable lookups

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: perf)

Attachments

(1 file)

No description provided.
Attachment #8876509 - Flags: review?(nfroyd)
FYI, there's also a Put call a little later in this function: http://searchfox.org/mozilla-central/rev/fee636af734a0ce6dc7335691cc94664bafc385d/dom/webbrowserpersist/nsWebBrowserPersist.cpp#2730,2732,2767 I guess we could replace that by using LookupForAdd instead of Get, but there are some interleaving returns (NS_ENSURE_SUCCESS) that makes that tricky. I wonder if it would be worth adding a "dead-mans-switch" thingy to EntryPtr that would automatically Remove any new entry in the dtor, unless OrInsert was called... (Could have used that in 1370674 to avoid the manual Removes.) Anyway, I don't expect this method to be very hot though...
Attachment #8876509 - Flags: review?(nfroyd) → review+
(Filed bug 1372333 on adding a Remove() method, automatic or not)
Blocks: 1372333
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/2fe892847030 Remove a redundant hashtable Contains call. r=froydnj
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: