longtasks
longtasks copied to clipboard
Can we find which script or function is taking longer than 50 ms?
In long task API has a name attribute, which value is self. It's not more specific detail to find long task. If we find which script or function is taking longer than 50 ms, the optimize is too easy.
Yes, long tasks V2 will have scriptUrl. Details in this doc: https://docs.google.com/document/d/125d69JAC7nyx-Ob0a9Z31d1uHUGu4myYQ3os9EnGfdU/edit
When will you release Long Task V2?
We are just starting to work on this, so hopefully in a couple of milestones.
If you release the feature within two or three weeks, it will be very helpful to me.
Actually , i have the same question as @Vasikaran : can we find which scripts are culprit for long Tasks (through the name field) and when the V2 of the API will be released. Thanks
We currently do not plan to expose the script URL, AFAIK. We don't have any concrete future work on how to make attribution better in general. This was deprioritized because of an effort on the sampling profiler, see https://github.com/WICG/js-self-profiling. Ideally after that is shipped then we can use it to surface some longtask attribution.
We did some experiments at Elastic, here are the relevant details - https://github.com/WICG/js-self-profiling/issues/21
FWIW, I'm cautiously hopeful to make progress on that using Task Tracking as infrastructure on top of which attribution can be built.
Marking as duplicate of https://github.com/w3c/longtasks/issues/89