Closed Bug 1356838 Opened 7 years ago Closed 7 years ago

Reduce the hashtable lookup cost in EnsureGlobalPredictor()

Categories

(Core :: Networking, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file)

EnsureGlobalPredictor() grabs an XPCOM service every time which is unnecessary.  We can save a hashtable lookup here quite easily.
Comment on attachment 8858551 [details] [diff] [review]
Reduce the hashtable lookup cost in EnsureGlobalPredictor()

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

Hooray! I've wanted something like this since I first wrote that code, but didn't know StaticRefPtr existed (or maybe it didn't then), and just had the "static ctors are bad!" mantra in my head (which is how we ended up where we are). Thanks!
Attachment #8858551 - Flags: review?(hurley) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/31f677cd6b27
Reduce the hashtable lookup cost in EnsureGlobalPredictor(); r=nwgh
https://hg.mozilla.org/mozilla-central/rev/31f677cd6b27
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: