Open Bug 1968286 Opened 3 months ago Updated 3 months ago

[meta] Improve rooting in JetStream3

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

People

(Reporter: mgaudet, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: meta)

Experimenting with BPF I ran every jetstream benchmark under bpf with the following bpftrace program:

uprobe:/home/matthew/unified-git/obj-opt-shell-x86_64-pc-linux-gnu/dist/bin/js:*registerWithRootLists*
{
   @call[ustack(perf,3)] = count()
}


uprobe:/home/matthew/unified-git/obj-opt-shell-x86_64-pc-linux-gnu/dist/bin/js:cpp:JS_ShutDown
{
   print(@call)
}

END {
    // Don't print map on exit.
    clear(@call)
}

the basic loop looking like

for BENCH in "${BENCHMARKS[@]}"; do
    echo "Running benchmark: $BENCH"
    sudo bpftrace ../../rootProfiler.bt -c "/home/matthew/unified-git/obj-opt-shell-x86_64-pc-linux-gnu/dist/bin/js cli.js $BENCH" > "${BENCH}-roots"
done

Now in order to get this to work, I had to do the following

  1. Add a sleep before exit (many many thanks to Zixian Cai who helped me figure this out)
  2. Print the map before the process exits rather than at bpftrace exit -- for some reason that doesn't symbolicate properly.
  3. Marked registerWithRootsList as MOZ_NO_INLINE.

The result of this experimentation is a github repo filled with root reports. They're all ordered from fewest to largest (aka, scroll to the bottom for the juicy stuff).

I'm going to open a few bugs about notable (in my opinion) cases that block this bug.

I should note: Every one of these bugs should be low priority individually, as the impact should be expected to be comparatively small overall. But this is also sometimes overhead we can just straight up get rid of, or reduce with RootedTuple and RootedField.

Depends on: 1968290
Depends on: 1968305
Depends on: 1968313
Severity: -- → N/A
Priority: -- → P3
Depends on: 1970673
You need to log in before you can comment on or make changes to this bug.