зеркало из https://github.com/mozilla/gecko-dev.git
d53b8b620f
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 |
||
---|---|---|
.. | ||
DumpFunctions.h | ||
ErrorMessages.h | ||
ErrorNumbers.msg | ||
StackLimits.h | ||
UsageStatistics.h | ||
WindowProxy.h |