Closed Bug 1001094 Opened 10 years ago Closed 10 years ago

nsJSID should implement nsIClassInfo

Categories

(Core :: XPConnect, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31
blocking-b2g 1.3T+
Tracking Status
b2g-v1.3T --- fixed

People

(Reporter: bholley, Assigned: bholley)

References

Details

(Whiteboard: [Memshrink])

Attachments

(1 file)

See the problem describe in bug 997906 comment 0. 

As it turns out, both nsJSIID and nsJSCID implement classinfo, but nsJSID doesn't. And nsJSID is what you get when you call xpc_NewIDObject, which is what we do during QI on XPCWrappedJS and whatnot.

It's not really clear to me why nsJSIID and nsCID do manual delegation to nsJSID instead of inheriting it. But I'm going to leave that one be for now, and just give nsJSID classinfo, which should solve our problem here.
In my rather fuzzy and noisy measurements, this brings js-non-window usage down by about 600k. This is probably worth taking on tarako.
blocking-b2g: --- → 1.3T?
Attachment #8412101 - Flags: review?(mrbkap)
(In reply to Bobby Holley (:bholley) from comment #1)
> In my rather fuzzy and noisy measurements, this brings js-non-window usage
> down by about 600k. This is probably worth taking on tarako.

Getting this on fabrice's radar.
Flags: needinfo?(fabrice)
Attachment #8412101 - Flags: review?(mrbkap) → review+
This is a super-safe patch. I'm pushing it directly to inbound given that we're probably going to want to take it on Tarako real soon now.

https://hg.mozilla.org/integration/mozilla-inbound/rev/347ecbf31a6a
Thanks, bholley!
> In my rather fuzzy and noisy measurements, this brings js-non-window usage
> down by about 600k. This is probably worth taking on tarako.

Is that measurement from desktop? Will the saving be similar on b2g, or does the system compartment merging make it less effective?
(In reply to Nicholas Nethercote [:njn] from comment #6)
> > In my rather fuzzy and noisy measurements, this brings js-non-window usage
> > down by about 600k. This is probably worth taking on tarako.
> 
> Is that measurement from desktop?

Yes.

> Will the saving be similar on b2g, or does
> the system compartment merging make it less effective?

It's hard to say. There will be fewer nsJSID XPCWNs, which makes it less effective. But there will be more XPCWrappedNativeProto sharing, which makes it _more_ effective.

Somebody should measure.
On a tarako I see a win of 60k in js-non-window in the parent, and a bit less in the homescreen. So still useful if it's really safe.
Flags: needinfo?(fabrice)
(In reply to Fabrice Desré [:fabrice] from comment #8)
> On a tarako I see a win of 60k in js-non-window in the parent, and a bit
> less in the homescreen. So still useful if it's really safe.

Yeah, it's quite safe.
blocking-b2g: 1.3T? → 1.3T+
https://hg.mozilla.org/mozilla-central/rev/347ecbf31a6a
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.