зеркало из 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 |
||
---|---|---|
.. | ||
experimental | ||
friend | ||
AllocPolicy.h | ||
AllocationRecording.h | ||
Array.h | ||
ArrayBuffer.h | ||
ArrayBufferMaybeShared.h | ||
BigInt.h | ||
BuildId.h | ||
CallArgs.h | ||
CallNonGenericMethod.h | ||
CharacterEncoding.h | ||
Class.h | ||
ComparisonOperators.h | ||
CompilationAndEvaluation.h | ||
CompileOptions.h | ||
ContextOptions.h | ||
Conversions.h | ||
Date.h | ||
Debug.h | ||
Equality.h | ||
ErrorReport.h | ||
Exception.h | ||
ForOfIterator.h | ||
GCAPI.h | ||
GCAnnotations.h | ||
GCHashTable.h | ||
GCPolicyAPI.h | ||
GCTypeMacros.h | ||
GCVariant.h | ||
GCVector.h | ||
HashTable.h | ||
HeapAPI.h | ||
Id.h | ||
Initialization.h | ||
JSON.h | ||
LocaleSensitive.h | ||
MemoryFunctions.h | ||
MemoryMetrics.h | ||
Modules.h | ||
OffThreadScriptCompilation.h | ||
Principals.h | ||
Printf.h | ||
ProfilingCategory.h | ||
ProfilingFrameIterator.h | ||
ProfilingStack.h | ||
Promise.h | ||
PropertyDescriptor.h | ||
PropertySpec.h | ||
ProtoKey.h | ||
Proxy.h | ||
Realm.h | ||
RealmOptions.h | ||
RefCounted.h | ||
RegExp.h | ||
RegExpFlags.h | ||
RequiredDefines.h | ||
Result.h | ||
RootingAPI.h | ||
SavedFrameAPI.h | ||
ScalarType.h | ||
SharedArrayBuffer.h | ||
SliceBudget.h | ||
SourceText.h | ||
StableStringChars.h | ||
Stream.h | ||
StructuredClone.h | ||
SweepingAPI.h | ||
Symbol.h | ||
TraceKind.h | ||
TraceLoggerAPI.h | ||
TracingAPI.h | ||
Transcoding.h | ||
TypeDecls.h | ||
UbiNode.h | ||
UbiNodeBreadthFirst.h | ||
UbiNodeCensus.h | ||
UbiNodeDominatorTree.h | ||
UbiNodePostOrder.h | ||
UbiNodeShortestPaths.h | ||
UbiNodeUtils.h | ||
UniquePtr.h | ||
Utility.h | ||
Value.h | ||
ValueArray.h | ||
Vector.h | ||
Warnings.h | ||
WasmModule.h | ||
WeakMapPtr.h | ||
Wrapper.h |