imgLoader::RemoveFromCache does unnecessary hashtable lookups

RESOLVED FIXED in Firefox 56

Status

()

P2
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: mats, Assigned: mats)

Tracking

({perf})

Trunk
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
(Assignee)

Comment 1

2 years ago
Created attachment 8876447 [details] [diff] [review]
Use LookupRemoveIf instead of Get+Remove to avoid unnecessary hashtable lookups

I doubt |aValue| can ever be null when we found an entry to remove,
but let's be conservative and do minimal changes here.
Attachment #8876447 - Flags: review?(nfroyd)
(Assignee)

Comment 2

2 years ago
Comment on attachment 8876447 [details] [diff] [review]
Use LookupRemoveIf instead of Get+Remove to avoid unnecessary hashtable lookups

Actually, nsRefPtrHashtable::Remove(KeyType aKey, UserDataType* aData)
might be a better choice here...
Attachment #8876447 - Flags: review?(nfroyd)
(Assignee)

Comment 3

2 years ago
Created attachment 8876448 [details] [diff] [review]
Use nsRefPtrHashtable::Remove instead of Get + nsBaseHashtable::Remove to avoid unnecessary hashtable lookups
Attachment #8876447 - Attachment is obsolete: true
Attachment #8876448 - Flags: review?(nfroyd)
Attachment #8876448 - Flags: review?(nfroyd) → review+

Comment 5

2 years ago
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b8c8bc6ba8b
Use nsRefPtrHashtable::Remove instead of Get + nsBaseHashtable::Remove to avoid unnecessary hashtable lookups.  r=froydnj

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/2b8c8bc6ba8b
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.