Closed
Bug 714642
Opened 13 years ago
Closed 13 years ago
Figure out some way to optimize nsXPCWrappedJS traversing
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 720686
People
(Reporter: smaug, Assigned: smaug)
References
Details
Attachments
(2 files, 3 obsolete files)
11.60 KB,
patch
|
Details | Diff | Splinter Review | |
1.82 KB,
patch
|
Details | Diff | Splinter Review |
In some cases we traverse lots of nsXPCWrappedJS objects.
We should try to do less or be faster.
Assignee | ||
Comment 1•13 years ago
|
||
*If* my testing is correct, in many cases about 65% of WrappedJS objects are certainly alive.
Would be great to be able to skip that.
Assignee | ||
Comment 2•13 years ago
|
||
Something like this.
Didn't seem to leak at least in simple tests, but let's see what
tryserver says
https://tbpl.mozilla.org/?tree=Try&rev=44772bdb3013
Assignee | ||
Comment 3•13 years ago
|
||
Um, is the patch all wrong :/
Assignee | ||
Comment 4•13 years ago
|
||
Comment on attachment 585330 [details] [diff] [review]
patch
Ok, this doesn't make sense, but something similar could.
Attachment #585330 -
Attachment is obsolete: true
Assignee | ||
Comment 5•13 years ago
|
||
So, I want to be able to mark WrappedJS object certainly alive.
Fortunately nsXPCWrappedJS has plenty of spare bits left.
Assignee | ||
Comment 6•13 years ago
|
||
On top of other stuff I have
Updated•13 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Assignee | ||
Comment 7•13 years ago
|
||
Something like this.
DOM code, for example, can then set the generation. This can be used to
optimize for example event listener traversing.
Assignee: nobody → bugs
Attachment #586507 -
Flags: review?(mrbkap)
Comment 8•13 years ago
|
||
Can we just skip these altogether? We need to add all C++->JS edges so that we hold alive everything from JS. To catch cross-compartment cycles, we only need either all C++->JS or all JS->C++ edges.
Assignee | ||
Comment 9•13 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #8)
> Can we just skip these altogether?
You mean removing the whole
for (XPCRootSetElem *e = mWrappedJSRoots; e ; e = e->GetNextRoot()) {
nsXPCWrappedJS *wrappedJS = static_cast<nsXPCWrappedJS*>(e);
?
Assignee | ||
Comment 10•13 years ago
|
||
Perhaps. Blake, Peter?
The patch is certainly safer option, since it would be used only in those cases when
the object is certainly owned by something black.
Comment 11•13 years ago
|
||
Yes, that's what I meant. It sounds like this is actually useful in either case, because it will squash things being held by black JS. We can investigate the more radical option in another bug.
Comment 12•13 years ago
|
||
Comment on attachment 586507 [details] [diff] [review]
patch
I don't understand the XPCWrappedJS stuff well enough to contribute here. Hopefully peterv can, though.
Attachment #586507 -
Flags: review?(mrbkap) → review?(peterv)
Comment 13•13 years ago
|
||
Err, that's the wrappedJS *traversal* stuff.
Assignee | ||
Comment 14•13 years ago
|
||
Comment on attachment 586507 [details] [diff] [review]
patch
I have a better plan for this.
Attachment #586507 -
Flags: review?(peterv)
Assignee | ||
Comment 15•13 years ago
|
||
Sorry for the -U 1, but I just manually cut the patch from a larger patch.
http://mxr.mozilla.org/mozilla-central/source/js/xpconnect/src/XPCJSRuntime.cpp#579
Attachment #586507 -
Attachment is obsolete: true
Attachment #590373 -
Flags: review?(peterv)
Assignee | ||
Comment 16•13 years ago
|
||
Oops, previous patch was missing the #include.
Attachment #591021 -
Flags: review?(peterv)
Attachment #591021 -
Flags: feedback?(continuation)
Assignee | ||
Updated•13 years ago
|
Attachment #590373 -
Attachment is obsolete: true
Attachment #590373 -
Flags: review?(peterv)
Assignee | ||
Comment 17•13 years ago
|
||
Comment on attachment 591021 [details] [diff] [review]
v3
This got merged to the generic xpc patch
Attachment #591021 -
Flags: review?(peterv)
Attachment #591021 -
Flags: feedback?(continuation)
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•