Closed Bug 831886 Opened 11 years ago Closed 11 years ago

[meta] Reduce performance cost of exact stack rooting

Categories

(Core :: JavaScript Engine, defect)

Other Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bhackett1024, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: meta)

Attachments

(2 files)

Enabling exact rooting currently slows down SS for me by 2.7% (linux/x64).  It would be good to reduce this to <1% or so, by refactoring and restructuring the code to reduce the number of roots required on hot paths.
Attached file hot rooting sites
Looking at sites where roots are created in SS points to a concentration in interpreter and object operations (as opposed to a more diffuse spread).  Out of 3.7 million roots created in a single run of the suite with 501 different callers creating roots, 69% of the roots are accounted for by the top 20 callers, and 90% by the top 60 callers.  Almost all of these roots can be removed.  Some are unnecessary given bug 772820, and most of the rest can be fixed by refactoring code so that there is a fallible path that is tried first and gives up if a GC or VM reentry is needed, plus a slower path that does full rooting and can handle all inputs.  I believe the latter strategy is similar to what v8 does.

Attached is the list of names, individual and cumulative hits for the top 60 functions which construct roots.
Attachment #703521 - Attachment is patch: false
Attached patch instrumentationSplinter Review
Patch with instrumentation for counting constructed roots for each caller.
Depends on: 832042
Depends on: 832972
Depends on: 834242
Depends on: 834826
With the various dependent bugs fixed, I now get a performance difference of <1ms on SS, or .4% when enabling exact rooting (linux/x64).  The number of constructed roots has been reduced to 22% of the original total, or 810k.

While there is always more that could be done here, this I think leaves us in pretty good shape as the roots fixed by the dependent bugs should help on most any workload rather than being SS specific.
Is Bug 791022 relevant here, too?
Blocks: 875863
No longer blocks: GenerationalGC
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Blocks: 1507445
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: