gecko-dev/js/public/friend
Chris Fallin d53b8b620f Bug 1656638: Add Wasm compile- and run-time telemetry to track Wasm compiler performance. r=lth
This patch adds telemetry to measure the time spent in Wasm compilers
and in the code that they generate (actually, all JS and Wasm code).

For simplicity, it measures wallclock time as a proxy for CPU time.
Furthermore, it measures runtime for all JS and Wasm code, and all
native functions invoked by the JS or Wasm code, by timing from
top-level entry to exit. This is for efficiency reasons: we do not want
to add a VM call in the transition stubs between native and JS or JS and
Wasm; that would be a Very Bad Thing for performance, even for a Nightly
build instrumented with telemetry. Because of that, it's difficult to
separate JITted JS and JITted Wasm runtime, but observing their sum
should still be useful when making comparisons across compiler changes
because absolute reductions will still be visible.

The plumbing is somewhat awkward, given that Wasm compilers can run on
background threads. It appears that the telemetry-callback API that
SpiderMonkey includes to avoid a direct dependency on the Gecko
embedding had artificially limited the callback to main-thread use only.
This patch removes that limitation, which is safe at least for Gecko;
the telemetry hooks in Gecko are thread-safe (they take a global mutex).
That way, the background threads performing compilation can directly add
telemetry incrementally, without having to pass this up through the main
thread somehow.

Finally, I have chosen to add the relevant metrics as Scalar telemetry
values rather than Histograms. This is because what we are really
interested in is the sum of all these values (all CPU time spent in
compilation + running Wasm code); if this value goes down as a result of
a Wasm compiler change, then that Wasm compiler change is good because
it reduces CPU time on the user's machine. It is difficult to add two
Histograms together because the bins may have different boundaries. If
we instead need to use a binned histogram for other reasons, then we
could simply report the sum (of all compiler time plus run time) as
another histogram.

Differential Revision: https://phabricator.services.mozilla.com/D85654
2020-08-06 01:28:45 +00:00
..
DumpFunctions.h Bug 1656411 - Move various dumping functions out of jsfriendapi.h to a new header. r=mgaudet 2020-07-31 16:20:19 +00:00
ErrorMessages.h
ErrorNumbers.msg
StackLimits.h Bug 1656411 - Move various stack limit-related functions (including reporting overrecursion) out of jsfriendapi.h to a new header. r=mgaudet 2020-07-31 16:33:40 +00:00
UsageStatistics.h Bug 1656638: Add Wasm compile- and run-time telemetry to track Wasm compiler performance. r=lth 2020-08-06 01:28:45 +00:00
WindowProxy.h Bug 1656411 - Move WindowProxy-related functions out of jsfriendapi.h to their own header. r=mgaudet 2020-07-31 16:11:36 +00:00