Closed
Bug 1376954
Opened 7 years ago
Closed 7 years ago
consider marking NodeList [ProbablyShortLivingWrapper]
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: bkelly, Assigned: bzbarsky)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
Attachments
(3 files)
2.59 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
3.81 KB,
patch
|
smaug
:
review+
jonco
:
review+
|
Details | Diff | Splinter Review |
840 bytes,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
NodeList is live updated and therefore expensive to maintain. Many scripts will do a query, check an attribute, and then throw it away, though. It would be nice if we could GC these short lives NodeList objects faster. I guess [ProbablyShortLivingWrapper] is the way to get these nursery collected.
Olli suggests there may be a problem using this with proxies, though.
Comment 1•7 years ago
|
||
Yeah, ProbablyShortLivingWrapper doesn't seem to do anything with proxies.
Reporter | ||
Updated•7 years ago
|
Blocks: Speedometer_V2
Assignee | ||
Comment 2•7 years ago
|
||
Does adding a check for it to CGDOMProxyJSClass.define and adding JSCLASS_SKIP_NURSERY_FINALIZE to "flags" as needed work?
As in, I'm pretty sure it works in terms of passing the JSClass flag to the JS engine. The question is whether that gives us nursery allocation, for a proxy.
Assignee | ||
Comment 3•7 years ago
|
||
Also, we should either make [ProbablyShortLivingWrapper] work on non-wrappercached things or fail codegen if you try to use it there.
Assignee | ||
Comment 4•7 years ago
|
||
OK, I have patches for this, but they won't work correctly (as in, either not allocate the object in the nursery, or crash if they do) without the blocking JS engine bugs fixed as well.
Assignee | ||
Comment 5•7 years ago
|
||
Attachment #8882088 -
Flags: review?(bugs)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•7 years ago
|
||
Attachment #8882089 -
Flags: review?(jcoppeard)
Attachment #8882089 -
Flags: review?(bugs)
Assignee | ||
Comment 7•7 years ago
|
||
Attachment #8882090 -
Flags: review?(bugs)
Comment 8•7 years ago
|
||
Comment on attachment 8882088 [details] [diff] [review]
part 1. Ensure that we don't try to nursery-allocate non-wrappercached DOM objects
ah, sorry, didn't recall that moving part yesterday.
Thanks for adding the comment.
Attachment #8882088 -
Flags: review?(bugs) → review+
Updated•7 years ago
|
Attachment #8882090 -
Flags: review?(bugs) → review+
Comment 9•7 years ago
|
||
Comment on attachment 8882089 [details] [diff] [review]
part 2. Support nursery allocation of DOM proxy objects
oh, Proxies have canNurseryAllocate method.
Could you add some comment to CGDOMJSProxyHandler_canNurseryAllocate explaining that it is for overriding the default canNurseryAllocate method in Proxy object.
(or maybe that is somehow obvious from the context not visible in the patch?)
Attachment #8882089 -
Flags: review?(bugs) → review+
Comment 10•7 years ago
|
||
Boris, if you profile running Speedometer with these patches applied, how much does MatchNameAttribute show up (please test on top of the fix for bug 1376936). See bug 1376936 comment 8, it seems like that fix helped cut down the cost of that function by about half, and I'm hoping that this bug would hopefully cut down the rest of the time as well, but it's hard to say since it depends on when the nursery GC will happen.
I mostly want to know whether we need to keep bug 1376695 itself as a Speedometer dependency or not! Thanks a lot.
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 11•7 years ago
|
||
> Boris, if you profile running Speedometer with these patches applied
These patches have no effect until the blocking spidermonkey bugs are fixed; see comment 4...
Flags: needinfo?(bzbarsky)
Comment 12•7 years ago
|
||
So we only need a fix for bug 1377055 right? Since the other one has a patch...
Assignee | ||
Comment 13•7 years ago
|
||
Right. I need to get hold of jonco and talk through some things to fix that one.
That said, I'd also love instructions for what the current best-practice is for profiling Speedometer, and which parts of it I should profile per comment 10.
Updated•7 years ago
|
Attachment #8882089 -
Flags: review?(jcoppeard) → review+
Assignee | ||
Comment 14•7 years ago
|
||
OK, so here's what I see locally, when loading http://speedometer2.benj.me/InteractiveRunner.html?suite=jQuery-TodoMVC then starting profiler, clicking Run, stopping the profiler once the test is done:
1) Without any local patches applied, I see about 4.6ms spent under MatchNameAttribute.
2) With bug 1376936 applied, I also see about 4.6ms spent under MatchNameAttribute.
3) With the patches for bug 1376936, bug 1377056, and bug 1377368 applied, I see 6.0ms under MatchNameAttribute.
(That said, as far as I can tell all these numbers are fairly noisy...)
If I'm not measuring the right testcase, please let me know.
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(ehsan)
Comment 15•7 years ago
|
||
yeah, I don't trust the ms numbers of individual runs.
Would need to write some microbenchmark and run it several times to get more reliable numbers.
Comment 16•7 years ago
|
||
I suggest running the full test suite instead and profile the first few hundred or so test runs. See the steps in bug 1376594 comment 6. I seem to get fairly reliable numbers this way.
Flags: needinfo?(ehsan)
Assignee | ||
Comment 17•7 years ago
|
||
OK, using those steps and the three situations from comment 14:
1) No patches: 14.6ms, see http://bit.ly/2txRdMT
2) With bug 1376936 applied: 1.7ms, see http://bit.ly/2txKwup
3) With the other patches applied (also including this bug, of course): No samples in MatchNameAttr at all, see http://bit.ly/2txWPXr
Make of that what you will, esp the fact that going from (1) to (2) I see a much bugger than 2x drop.
Comment 18•7 years ago
|
||
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6dfa4b51c236
part 1. Ensure that we don't try to nursery-allocate non-wrappercached DOM objects. r=smaug
https://hg.mozilla.org/integration/autoland/rev/7acbc4152930
part 2. Support nursery allocation of DOM proxy objects. r=smaug,jonco
https://hg.mozilla.org/integration/autoland/rev/6acce622c977
part 3. Allow nursery allocation of DOM nodelists. r=smaug
Reporter | ||
Updated•7 years ago
|
Blocks: dom-nursery
Comment 19•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6dfa4b51c236
https://hg.mozilla.org/mozilla-central/rev/7acbc4152930
https://hg.mozilla.org/mozilla-central/rev/6acce622c977
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•