- From: Noam Rosenthal <notifications@github.com>
- Date: Mon, 15 Jul 2024 05:33:00 -0700
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/webidl/pull/1400/c2228397336@github.com>
> I think I need a higher-level explanation of the objectives here in order to be able to review. It's not entirely clear to me what is being measured. Sure! What we're trying to measure here is the script entry point: from the moment an author script (callback, event-listener, promise resolution, script evaluation) started running until it has a clear stack and all the related microtasks have been executed. This should give authors a hint regarding hot-spots in their code that cause long animation frames (and potential jank as a result). The start and end of an "entry point" are the places are equivalent to these spots in the HTML spec: - [before the first phase here](https://html.spec.whatwg.org/multipage/webappapis.html#prepare-to-run-script) when the [execution context stack](https://tc39.es/ecma262/#execution-context-stack) is empty. - [after the last phase here](https://html.spec.whatwg.org/multipage/webappapis.html#clean-up-after-running-script) when the [execution context stack](https://tc39.es/ecma262/#execution-context-stack) is empty. The time spent between those two points are "time spent in JS execution". The only reason not to spec it exactly like the above is that in those two functions we "lost" some of the metadata of how the platform invoked the script, e.g. information about the callback/event or whether it's a resolved/rejected promise. So instead, the "start" of the entry point is recorded at the locations that can trigger script execution, and the "end" is recorded at the aforementioned "cleanup" location. Does this make more sense? -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/webidl/pull/1400#issuecomment-2228397336 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/webidl/pull/1400/c2228397336@github.com>
Received on Monday, 15 July 2024 12:33:04 UTC