gecko-dev/js/public
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
..
experimental Bug 1656411 - Move typed array, ArrayBuffer, and dataview-related functions out of jsfriendapi.h to two new headers. r=mgaudet,jgilbert 2020-07-31 16:37:27 +00:00
friend Bug 1656638: Add Wasm compile- and run-time telemetry to track Wasm compiler performance. r=lth 2020-08-06 01:28:45 +00:00
AllocPolicy.h
AllocationRecording.h
Array.h
ArrayBuffer.h
ArrayBufferMaybeShared.h
BigInt.h Bug 1606568 - Add public BigInt API. r=jwalden 2020-07-22 02:53:06 +00:00
BuildId.h
CallArgs.h
CallNonGenericMethod.h
CharacterEncoding.h Bug 1606568 - Add JS::ConstLatin1Chars. r=jwalden 2020-07-22 02:53:49 +00:00
Class.h Bug 1654927 - Move js.msg and js::GetErrorMessage into a new js/public/friend directory so users of them don't have to depend on all of jsfriendapi.h. r=mgaudet 2020-07-29 04:44:50 +00:00
ComparisonOperators.h
CompilationAndEvaluation.h Bug 1501608 - Remove the ELEMENT_SLOT in the ScriptSourceObject and instead use a callback function to return the script element based on the value of the privateValue in the SSO. r=jonco,smaug 2020-05-12 19:28:15 +00:00
CompileOptions.h Bug 1635839 - Part 4: Add an option for private class fields, disabled by default r=jorendorff 2020-06-02 20:58:04 +00:00
ContextOptions.h Bug 1654286 - Convert private fields option to a JSContext option r=jandem 2020-07-27 20:24:20 +00:00
Conversions.h
Date.h
Debug.h
Equality.h
ErrorReport.h Bug 1654927 - Move js.msg and js::GetErrorMessage into a new js/public/friend directory so users of them don't have to depend on all of jsfriendapi.h. r=mgaudet 2020-07-29 04:44:50 +00:00
Exception.h
ForOfIterator.h
GCAPI.h Bug 1482089 - pt 3. Remove formatJsonTelemetry from GCAPI r=jonco 2020-07-21 05:18:59 +00:00
GCAnnotations.h
GCHashTable.h Bug 1470369 - Don't collect the nursery every GC slice during sweeping r=sfink 2020-06-03 08:10:45 +00:00
GCPolicyAPI.h
GCTypeMacros.h Bug 1642154 : Add JSLinearString to MapTypeToTraceKind. r=jonco 2020-06-05 19:08:49 +00:00
GCVariant.h
GCVector.h Bug 1648574 - Support lazy function. r=nbp 2020-07-30 11:01:52 +00:00
HashTable.h
HeapAPI.h Bug 1652447 - Remove IsAboutToBeFinalizedDuringSweep and replaces uses with IsAboutToBeFinalized r=sfink 2020-07-13 15:05:03 +00:00
Id.h
Initialization.h
JSON.h
LocaleSensitive.h
MemoryFunctions.h
MemoryMetrics.h Bug 1654523 - Insist that iteration callbacks don't GC r=sfink,mccr8 2020-07-23 02:31:57 +00:00
Modules.h Bug 1657066 - Dynamic module import doesn't handle uncatchable exceptions r=jandem 2020-08-05 08:38:36 +00:00
OffThreadScriptCompilation.h Bug 1642708 - Remove code guarded by JS_BUILD_BINAST r=arai 2020-06-17 14:26:09 +00:00
Principals.h
Printf.h
ProfilingCategory.h Bug 1645464 - Use a shared ProfilingCategoryList.h r=gerald,froydnj 2020-06-15 13:59:55 +00:00
ProfilingFrameIterator.h
ProfilingStack.h Bug 1645469 - Add profiler subcategories for SpiderMonkey JITs. r=jandem,gerald 2020-06-15 14:56:50 +00:00
Promise.h Bug 1223932 - delete guard object uses from the tree; r=jwalden 2020-07-30 14:22:38 +00:00
PropertyDescriptor.h
PropertySpec.h
ProtoKey.h Bug 1644171 - Add AsyncIterator constructor. r=jorendorff 2020-06-08 20:43:56 +00:00
Proxy.h Bug 1655443 - Redesign private name proxy support to be more clear and simpler r=jorendorff 2020-07-27 21:08:42 +00:00
Realm.h Bug 1654523 - Insist that iteration callbacks don't GC r=sfink,mccr8 2020-07-23 02:31:57 +00:00
RealmOptions.h Bug 1654286 - Convert private fields option to a JSContext option r=jandem 2020-07-27 20:24:20 +00:00
RefCounted.h
RegExp.h Bug 1636495: Add JS::CheckRegExpSyntax r=evilpie 2020-05-13 14:53:18 +00:00
RegExpFlags.h
RequiredDefines.h
Result.h
RootingAPI.h Bug 1223932 - delete guard object uses from the tree; r=jwalden 2020-07-30 14:22:38 +00:00
SavedFrameAPI.h
ScalarType.h Bug 1656411 - Move typed array, ArrayBuffer, and dataview-related functions out of jsfriendapi.h to two new headers. r=mgaudet,jgilbert 2020-07-31 16:37:27 +00:00
SharedArrayBuffer.h
SliceBudget.h
SourceText.h
StableStringChars.h Bug 1645415 - Mark all relevant strings non-deduplicatable r=jonco 2020-07-10 17:06:25 +00:00
Stream.h
StructuredClone.h
SweepingAPI.h Bug 1652425 - Make WeakCache::sweep conservatively take the store buffer lock r=sfink 2020-07-13 15:00:28 +00:00
Symbol.h Bug 1635839 - Part 1: Add PrivateName Symbol code. r=jorendorff 2020-06-02 20:57:34 +00:00
TraceKind.h Bug 1642154 : Add JSLinearString to MapTypeToTraceKind. r=jonco 2020-06-05 19:08:49 +00:00
TraceLoggerAPI.h
TracingAPI.h
Transcoding.h
TypeDecls.h
UbiNode.h
UbiNodeBreadthFirst.h
UbiNodeCensus.h
UbiNodeDominatorTree.h
UbiNodePostOrder.h
UbiNodeShortestPaths.h Backed out changeset d3c78f4a1465 (bug 1648646) for regressing bug 1649342 and bug 1649433. CLOSED TREE 2020-07-03 01:20:31 +03:00
UbiNodeUtils.h
UniquePtr.h
Utility.h Bug 1645845 - Add ParserAtomsTable, parser atoms types, common parser names table, and base parser atoms implementation. r=mgaudet,tcampbell 2020-06-17 22:31:35 +00:00
Value.h Bug 1502355 - Store the value optionally passed to finalizing as an extra value in a handler function. r=arai 2020-06-24 18:40:45 +00:00
ValueArray.h Bug 1223932 - delete guard object uses from the tree; r=jwalden 2020-07-30 14:22:38 +00:00
Vector.h
Warnings.h
WasmModule.h Bug 1599634 - Move the JS::WasmModule definition to own header r=bbouvier 2020-06-04 15:36:11 +00:00
WeakMapPtr.h
Wrapper.h Bug 1655443 - Redesign private name proxy support to be more clear and simpler r=jorendorff 2020-07-27 21:08:42 +00:00