Closed
Bug 827471
Opened 12 years ago
Closed 12 years ago
Improve CanSkipWrappedJS
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: smaug, Assigned: smaug)
Details
Attachments
(1 file, 2 obsolete files)
|
1.35 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
I have quite a few WrappedJS objects in my graph. They are objects
holding root WrappedJS object alive, so they are are always in pair.
We optimize out only root wrappedJS, but non-root wrappedJS brings back also the root.
I don't expect this to speed up anything, but makes graphs easier to analyze.
https://tbpl.mozilla.org/?tree=Try&rev=5487bf997839
| Assignee | ||
Comment 1•12 years ago
|
||
Hmm, not quite that simple.
| Assignee | ||
Comment 2•12 years ago
|
||
Attachment #698813 -
Attachment is obsolete: true
| Assignee | ||
Comment 3•12 years ago
|
||
Attachment #698828 -
Attachment is obsolete: true
Attachment #698910 -
Flags: review?(continuation)
| Assignee | ||
Comment 4•12 years ago
|
||
This should get rid of about 30% of objects in my current graph.
Comment 5•12 years ago
|
||
Comment on attachment 698910 [details] [diff] [review]
v3
Review of attachment 698910 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/xpconnect/src/XPCJSRuntime.cpp
@@ +435,4 @@
> if (nsCCUncollectableMarker::sGeneration &&
> (!obj || !xpc_IsGrayGCThing(obj)) &&
> !wrappedJS->IsSubjectToFinalization() &&
> + (isRootWrappedJS || CanSkipWrappedJS(wrappedJS->GetRootWrapper()))) {
Are these chains of root wrappers going to be fairly short? The time to visit them all is going to be quadratic in the length of these chains, which could get ugly.
@@ +435,5 @@
> if (nsCCUncollectableMarker::sGeneration &&
> (!obj || !xpc_IsGrayGCThing(obj)) &&
> !wrappedJS->IsSubjectToFinalization() &&
> + (isRootWrappedJS || CanSkipWrappedJS(wrappedJS->GetRootWrapper()))) {
> + if (!wrappedJS->IsAggregatedToNative() || !isRootWrappedJS) {
The additional quick case here occurs when the wrapped JS IsAggregatedToNative(), but also CanSkipWrappedJS() on its root wrapper. Why is that okay to not look at the aggregated native object? I admit to not knowing what is going on in the else case here.
| Assignee | ||
Comment 6•12 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #5)
> Are these chains of root wrappers going to be fairly short? The time to
> visit them all is going to be quadratic in the length of these chains, which
> could get ugly.
All the chains I've seen have been short. Just one wrappedjs under root
> The additional quick case here occurs when the wrapped JS
> IsAggregatedToNative(), but also CanSkipWrappedJS() on its root wrapper. Why
> is that okay to not look at the aggregated native object? I admit to not
> knowing what is going on in the else case here.
Because aggregated native object hangs in the root
Comment 7•12 years ago
|
||
Comment on attachment 698910 [details] [diff] [review]
v3
Great! Thanks for the explanations.
Attachment #698910 -
Flags: review?(continuation) → review+
| Assignee | ||
Comment 8•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Target Milestone: --- → mozilla21
You need to log in
before you can comment on or make changes to this bug.
Description
•