Bug 1636246 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

At the moment, our WebIDL code generator creates Gecko Profiler labels for WebIDL method calls (and getters and setters and constructors). However, these profiler labels do not contain any additional data.

There are some calls that would really benefit from extra data. Examples:

 - `ChromeUtils.import` could really use the module URL.
 - `JSWindowActorChild.sendAsyncMessage` could use the message name
 - `Document.querySelectorAll` could use the selector string

Example profile: https://perfht.ml/2WzEXHX

At the moment, we do have the extra data for some of these in other profiler labels, but not in the ones that are shown in the JavaScript-centric call tree. We could show those in the JavaScript-centric tree by setting the RELEVANT_FOR_JS flag on these labels, but then we end up with duplicated labels: For example, we'd have `ChromeUtils.import` calling `ChromeUtils::Import <moduleURL>`.

So instead, I think we should add the ability to special-case this set of methods: The WebIDL code generator should stop emitting labels for them, and instead the called C++ code should make its profiler label RELEVANT_FOR_JS. That way, it'll be shown in the JavaScript-centric view and there will be no duplication.
At the moment, our WebIDL code generator creates Gecko Profiler labels for WebIDL method calls (and getters and setters and constructors). However, these profiler labels do not contain any additional data.

There are some calls that would really benefit from extra data. Examples:

 - `ChromeUtils.import` could really use the module URL.
 - `EventTarget.dispatchEvent` could use the event name
 - `JSWindowActorChild.sendAsyncMessage` could use the message name
 - `Document.querySelectorAll` could use the selector string

Example profile: https://perfht.ml/2WzEXHX

At the moment, we do have the extra data for some of these in other profiler labels, but not in the ones that are shown in the JavaScript-centric call tree. We could show those in the JavaScript-centric tree by setting the RELEVANT_FOR_JS flag on these labels, but then we end up with duplicated labels: For example, we'd have `ChromeUtils.import` calling `ChromeUtils::Import <moduleURL>`.

So instead, I think we should add the ability to special-case this set of methods: The WebIDL code generator should stop emitting labels for them, and instead the called C++ code should make its profiler label RELEVANT_FOR_JS. That way, it'll be shown in the JavaScript-centric view and there will be no duplication.
At the moment, our WebIDL code generator creates Gecko Profiler labels for WebIDL method calls (and getters and setters and constructors), using AUTO_PROFILER_LABEL_DYNAMIC_FAST. However, these profiler labels do not contain any additional data.

There are some calls that would really benefit from extra data. Examples:

 - `ChromeUtils.import` could really use the module URL.
 - `EventTarget.dispatchEvent` could use the event name
 - `JSWindowActorChild.sendAsyncMessage` could use the message name
 - `Document.querySelectorAll` could use the selector string

Example profile: https://perfht.ml/2WzEXHX

At the moment, we do have the extra data for some of these in other profiler labels, but not in the ones that are shown in the JavaScript-centric call tree. We could show those in the JavaScript-centric tree by setting the RELEVANT_FOR_JS flag on these labels, but then we end up with duplicated labels: For example, we'd have `ChromeUtils.import` calling `ChromeUtils::Import <moduleURL>`.

So instead, I think we should add the ability to special-case this set of methods: The WebIDL code generator should stop emitting labels for them, and instead the called C++ code should make its profiler label RELEVANT_FOR_JS. That way, it'll be shown in the JavaScript-centric view and there will be no duplication.

Back to Bug 1636246 Comment 0