Closed Bug 1393885 Opened 7 years ago Closed 7 years ago

provide a faster path for do_GetWeakReference

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

NS_GetWeakReference, called from do_GetWeakReference, QI's its argument
to nsISupportsWeakReference to determine whether a weak reference can be
obtained.  If NS_GetWeakReference is already receiving a
nsISupportsWeakReference pointer, or something than can be converted to
one, then we can skip the QI for a small performance win.
This only fires in ~5% of all calls to do_GetWeakReference, but it's an easy win.

I thought about trying to factor the common code out of the NS_GetWeakReference
implementations, but decided it wasn't worth it.  If you feel differently, I
can try to do that.
Attachment #8901274 - Flags: review?(erahm)
Comment on attachment 8901274 [details] [diff] [review]
provide a faster path for do_GetWeakReference

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

Sorry I looked at this earlier, but forgot to r+
Attachment #8901274 - Flags: review?(erahm) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f56376db333b
provide a faster path for do_GetWeakReference; r=erahm
https://hg.mozilla.org/mozilla-central/rev/f56376db333b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.