Closed
Bug 1161726
Opened 10 years ago
Closed 10 years ago
Speed up minor collections
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: terrence, Assigned: terrence)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
59.41 KB,
patch
|
jonco
:
review+
|
Details | Diff | Splinter Review |
TL;DR
╰> octane goes from 41859 -> 42414
╰> octane has ~15% fewer nursery collections taking >500us
The current patch is very simple: it moves the existing nursery collection code to Marking.cpp, uses a new JSTracer subclass to avoid the indirect call overhead, and specializes StoreBuffer::*::mark to skip DispatchToTracer. Microbenchmarks show that traversing a store buffer is roughly 2x faster with the patch applied.
Further work is needed here: I want to experiment with using a mark stack instead of an inline list to see if I can eek out any further improvements. Also, we should be able to share some of this code with processMarkStackTop, somehow.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5db59d84dabf
Attachment #8601694 -
Flags: review?(jcoppeard)
Assignee | ||
Comment 1•10 years ago
|
||
Missing a qref.
Attachment #8601694 -
Attachment is obsolete: true
Attachment #8601694 -
Flags: review?(jcoppeard)
Attachment #8601696 -
Flags: review?(jcoppeard)
Comment 2•10 years ago
|
||
Comment on attachment 8601696 [details] [diff] [review]
18_custom_marking_for_nursery-v0.diff
Review of attachment 8601696 [details] [diff] [review]:
-----------------------------------------------------------------
This is great!
::: js/src/gc/Nursery-inl.h
@@ +21,5 @@
> MOZ_ASSERT(isInside((void*)*ref));
> const gc::RelocationOverlay* overlay = reinterpret_cast<const gc::RelocationOverlay*>(*ref);
> if (!overlay->isForwarded())
> return false;
> /* This static cast from Cell* restricts T to valid (GC thing) types. */
This comment needs updating/removing.
Attachment #8601696 -
Flags: review?(jcoppeard) → review+
Assignee | ||
Comment 3•10 years ago
|
||
Comment 5•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Comment 6•10 years ago
|
||
Comment on attachment 8601696 [details] [diff] [review]
18_custom_marking_for_nursery-v0.diff
>--- a/js/src/gc/Nursery.cpp
>+++ b/js/src/gc/Nursery.cpp
[...]
>-struct TenureCount
>+js::TenuringTracer::TenuringTracer(JSRuntime* rt, Nursery* nursery)
>+ : JSTracer(rt, JSTracer::TracerKindTag::Tenuring, TraceWeakMapKeysValues)
>+ , nursery_(*nursery)
>+ , tenuredSize(0)
>+ , head(nullptr)
>+ , tail(&head)
>+ , savedRuntimeNeedBarrier(rt->needsIncrementalBarrier())
>+#ifdef JS_GC_ZEAL
>+ , verifyingPostBarriers(nullptr)
>+#endif
> {
This "verifyingPostBarriers" initialization causes Werror build bustage for me, locally (with clang 3.7).
The build warning (error) is:
> js/src/gc/Nursery.cpp:383:27: error: implicit conversion of nullptr constant to 'bool' [-Werror,-Wnull-conversion]
> , verifyingPostBarriers(nullptr)
> ~^~~~~~~
> 1 error generated.
Terrence, should this be s/nullptr/false/? Could you push a followup to fix?
Comment 7•10 years ago
|
||
Ah, terrence says on IRC that bug 1161353 (which just landed) will address comment 6.
You need to log in
before you can comment on or make changes to this bug.
Description
•