Closed Bug 831886 Opened 7 years ago Closed 7 years ago
[meta] Reduce performance cost of exact stack rooting
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.
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
Patch with instrumentation for counting constructed roots for each caller.
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?
You need to log in before you can comment on or make changes to this bug.