Closed Bug 1371953 Opened 7 years ago Closed 7 years ago

MediaCache does unnecessary hashtable lookups?

Categories

(Core :: Audio/Video: Playback, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

Details

(Keywords: perf)

Attachments

(1 file)

It looks like the two RemoveEntry calls marked here:
http://searchfox.org/mozilla-central/rev/12afa8cc9cea4a141494f767541b411845eef7a0/dom/media/MediaCache.cpp#546-547,577,579,584
could instead call RemoveEntry(e1/e2) respectively.
There are no assignments to 'e1' leading up to the first RemoveEntry,
and 'e2' is carefully refreshed on line 579 so it should be valid too.

Calling RemoveEntry(EntryType*) rather than RemoveEntry(key) avoids
the hashtable lookup.
Comment on attachment 8876426 [details] [diff] [review]
Avoid unnecesary hashtable lookups by using RemoveEntry(EntryType*) rather than RemoveEntry(key) in a couple of places

Review of attachment 8876426 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you for this, Mats.
Attachment #8876426 - Flags: review?(gsquelart) → review+
Component: Audio/Video → Audio/Video: Playback
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f8b9798f6270
Avoid unnecesary hashtable lookups by using RemoveEntry(EntryType*) rather than RemoveEntry(key) in a couple of places.  r=gerald
https://hg.mozilla.org/mozilla-central/rev/f8b9798f6270
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: