Comments (7)
I can see how sending coarse timestamps could make it seem like there is a 1ms regression in some cases where in fact there is a much smaller fluctuation. Also, for the sake of consistency maybe it's better to keep it like the other APIs where you coarsen based on COIC
from longtasks.
Given that the durations are times that are larger than 50ms, would it make sense to always coarsen the timestamps passed to the algorithm, for simplicity? I don't think there's any advantage/use-case here for more accurate timers.
from longtasks.
Given that the durations are times that are larger than 50ms, would it make sense to always coarsen the timestamps passed to the algorithm, for simplicity? I don't think there's any advantage/use-case here for more accurate timers.
Yes I believe it's OK to have all of them as coarse.
from longtasks.
Given that the durations are times that are larger than 50ms, would it make sense to always coarsen the timestamps passed to the algorithm, for simplicity?
My worry here is that coarsening is extremely implementation-defined, and includes jitter. E.g. consider a task which starts at t = 5 ms
and ends at t = 60 ms
, and thus is 55 ms long (over the 50 ms threshold). After applying jitter these timestamps could become t = 15 ms
and t = 60 ms
, thus only 45 ms (under the 50 ms threshold).
Or, if the implementation-defined time resolution in the coarsen time algorithm is more like 1 second (perhaps something a browser might do for background tabs), then those would both get coarsened to t = 0 ms
, and thus the task would not be long. But a pair like t = 499 ms
and t = 501 ms
would get coarsened to t = 0 ms
and t = 1000 ms
.
from longtasks.
Yes I'm not sure we need to simplify it that much. maybe it's better to send the unsafe high-res time to longtask
and coarsen it per-document here.
@yoavweiss ?
from longtasks.
@domenic - user agents vary in their coarsening and jitter applied, but they generally limit this to 1ms. As such a 49.5 ms task may be considered long in some UAs and not others, but since the LT limit is so much larger than the coarsening limits, I'm not sure that'd be an issue in practice.
At the same time, we could apply the coarsening at the API level if y'all think it's best.
from longtasks.
user agents vary in their coarsening and jitter applied, but they generally limit this to 1ms.
If this could be stated somewhere in the spec that'd be especially useful :)
Anyway, I'm happy where this landed, for HTML integration purposes.
from longtasks.
Related Issues (20)
- Some references are broken after navigation refactor
- New proposal: long animation frames HOT 6
- Broken references in Long Tasks API
- Typo
- supported entry types needs to be context aware HOT 2
- Provide explanation for the 50ms threshold HOT 2
- containerType is confusing HOT 5
- containerSrc could be long (a data URI) HOT 16
- Container information should be hidden if container appeared in cross-origin frames
- "multiple-contexts" doesn't seem useful HOT 4
- Top-level browsing context scoping HOT 10
- Event loop timing reporting seems to ignore reentrancy HOT 13
- Reporting work outside of event loop can cause leaks HOT 9
- Combination of paint timing and long tasks can expose precise paint timing HOT 3
- Attribution for alert() or other tasks blocked by user input
- Privacy & Security mitigations should not be in an external document
- Should LongTasks from same-origin same-event-loop tabs be reported? HOT 2
- Generic model for causal attribution (non-sampling based) HOT 9
- Demo links don't work HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from longtasks.