Align wake ups of JavaScript timers for unimportant cross-origin frames. Currently, DOM timers <32ms are all opt-out from AlignWakeUps [1] due to performance concerns. This is very conservative and actually some unimportant frames are eligible to use JS timer alignment. WebKit uses the policy to align DOM timer of non-interacted cross origin frames to 30ms. This feature adds JavaScript timer wake up alignment for unimportant frames on foreground pages. Unimportant frames means they are cross origin, visible but have small proportion of page’s visible area, and have no user interaction. [1] https://chromium-review.googlesource.com/c/chromium/src/+/4589092
None
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
None
Hello,
To clarify: is this intended to be an I2E, or a Developer Trial? According to https://chromestatus.com/feature/5106220399853568, it appears you are in the dev trial stage. But you mention stable experiment below... so perhaps that's a process mistake?
Can you give more info on the experiment timelines and what
stable percentages you are requesting permission to experiment on?
On 2/22/24 2:30 AM, Zheda Chen wrote:
Contact emailshttps://html.spec.whatwg.org/multipage/timers-and-user-prompts.html
SummaryAlign wake ups of JavaScript timers for unimportant cross-origin frames. Currently, DOM timers <32ms are all opt-out from AlignWakeUps [1] due to performance concerns. This is very conservative and actually some unimportant frames are eligible to use JS timer alignment. WebKit uses the policy to align DOM timer of non-interacted cross origin frames to 30ms. This feature adds JavaScript timer wake up alignment for unimportant frames on foreground pages. Unimportant frames means they are cross origin, visible but have small proportion of page’s visible area, and have no user interaction. [1] https://chromium-review.googlesource.com/c/chromium/src/+/4589092
Blink componentNone
TAG review status
Not applicable
Risks
Interoperability and CompatibilityNone
Gecko: No signal
WebKit: No signal
Web developers: No signals
Other signals:
WebView application risksDoes this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
Goals for experimentationWe plan to experiment on stable to confirm whether we observe same performance improvement as on lower channels and similar power benefit as in the lab. We will decide whether this feature ships based on the experiment data.
Ongoing technical constraintsNone
DebuggabilityNone
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?
None
Finch feature nameThrottleUnimportantFrameTimers
Requires code in //chrome?False
Tracking bughttps://issues.chromium.org/issues/40942028
Estimated milestones
DevTrial on desktop
122
DevTrial on Android
122
Link to entry on the Chrome Platform Statushttps://chromestatus.com/feature/5106220399853568
This intent message was generated by Chrome Platform Status.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/38855cfe-3bf3-4a04-b96a-81adaa5ba72fn%40chromium.org.
Could you say more why you would like to experiment on 50% of
stable, vs requesting permission to ship? That's quite a leap from
1% - and it seems you already have results demonstrating
performance improvements.
Also, mind answering the question of specifying "unimportant
frames"?
My concern is going from 1% to 50% on stable - if something does go wrong, that's a _lot_ of folks who will experience it. Are you open to something smaller like 5%? If not, why not?
thx
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/1996ccec-101e-4738-99d9-56855c8d33ec%40chromium.org.
In general, I think it's best to file a formal Intent to Ship if you want to go to 50% stable.
Align wake ups of JavaScript timers for unimportant cross-origin frames. Currently, DOM timers <32ms are all opt-out from AlignWakeUps [1] due to performance concerns. This is very conservative and actually some unimportant frames are eligible to use JS timer alignment. WebKit uses the policy to align DOM timer of non-interacted cross origin frames to 30ms. This feature adds JavaScript timer wake up alignment for unimportant frames on foreground pages. Unimportant frames means they are cross origin, visible but have non-large proportion of page’s visible area, and have no user interaction. [1] https://chromium-review.googlesource.com/c/chromium/src/+/4589092
None
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
NoneThis intent has ended up in a strange state in the chromestatus
tool, missing various flags I would have expected. Is that because
the intent predates some of the chromestatus updates or because it
started as an origin trial? If so, maybe the simplest is to refile
it, or can it be made to be a proper Intent to Ship with all the
buttons and bullets?
Another few things though, and I hope I'm not repeating something already covered elsewhere.
First, I really like the idea of doing optimizations that have a
measurable impact on user behaviour and probably also power usage
and energy usage so I approve of this work. But then I have
questions.
The text mentions that WebKit uses an alignment on 30
milliseconds intervals, but what is the intention for Chromium?
Also 30 milliseconds?
If the idea is for it to be 30 milliseconds, that would be too sparse to allow 60 fps animations run on setTimeout. If so, is that intentional, and would that be acceptable?
I ask in particular, because "uninteresting iframe" is vaguely defined so I don't know how much content will be misclassified as "uninteresting".
In general, is the answer to my questions above covered by some specification we can point people to when they wonder why something behaves inexplicably?
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM0wra-MsdhXA1Edddo_g0MXevycPrroqyxNXVm9S-4aCwZXTw%40mail.gmail.com.
One more question, is requestAnimationFrame affected at all or will that still work just as before?
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/84ea7a78-d9e2-40d2-adf7-3185f4d2a2d9%40gmail.com.
The privacy and security teams review all intents, so requesting reviews and answering the relevant questionnaires is the best path forward.
Looking forward to the new I2S - thanks!
Align wake ups of JavaScript timers for unimportant cross-origin frames. Currently, DOM timers <32ms are all opt-out from AlignWakeUps [1] due to performance concerns. This is very conservative and actually some unimportant frames are eligible to use JS timer alignment. WebKit uses the policy to align DOM timer of non-interacted cross origin frames to 30ms. This feature adds JavaScript timer wake up alignment for unimportant frames on foreground pages. Unimportant frames means they are cross origin, visible but have non-large proportion of page’s visible area, and have no user interaction. The alignment interval is 32ms. [1] https://chromium-review.googlesource.com/c/chromium/src/+/4589092
"Other vendors already have interoperable implementation" Safari has a similar intervention. DOM timers of non-interacted cross origin frames are aligned to 30ms. In Firefox, all DOM timers (both same-origin and cross-origin) in foreground pages would be aligned to 16ms. "A mature specification in the relevant standards body" This intervention is spec-compliant. The spec mentions "the SetTimeout/SetInterval API does not guarantee that timers will run exactly on schedule. Delays due to CPU load, other tasks, etc, are to be expected. ". The wait length of time is implementation-defined, "which is intended to allow user agents to pad timeouts as needed to optimize the power usage of the device. " https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html "A shared test suite for that specification" It isn't clear what should be tested specifically for this intervention since the spec allows waiting for an "implementation-defined" length.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
This intervention doesn't require changes to the spec. Timers are already covered by Web Platform Tests.
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
NoneYou should be able to see all the various bits for approvals in your chromestatus entry now, can you fill them out please?
There have been a few questions/comments about the lack of
clarity of what "unimportant cross-origin frames" are. What
exactly is the definition? You mention that Safari has a similar
intervention - how similar is it? Do we know? I wonder if there is
alignment for this "unimportant cross-origin frame" concept, if we
shouldn't specify that somehow.
The privacy/security/enterprise/debuggability gates are requested on Chrome Status. Testing gate to be requested later."Unimportant" cross origin frames means they are cross-origin, visible but use non-large proportion (<75%) of page's visible area and have not received a user gesture. All 3 conditions should be met. The criteria are too long so we use "unimportant" concept here.This intervention is spec-compliant. The spec mentions "the SetTimeout/SetInterval API does not guarantee that timers will run exactly on schedule. Delays due to CPU load, other tasks, etc, are to be expected". The wait length of time is implementation-defined, "which is intended to allow user agents to pad timeouts as needed to optimize the power usage of the device". In Safari, DOM timers of non-interacted cross origin frames are aligned to 30ms after reaching max nesting level (>=5). In Firefox, all DOM timers of frames (both same origin and cross origin) are aligned to 16ms. See details in "Interoperability and Compatibility Risks", "Safari views", "Firefox views".
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/7b8b9b84-2285-4fa9-a80d-c5fc0c1c0c41n%40chromium.org.
On 3/22/24 1:37 AM, Yoav Weiss (@Shopify) wrote:
On Thu, Mar 21, 2024 at 10:11 AM Zheda Chen <zheda...@intel.com> wrote:
The privacy/security/enterprise/debuggability gates are requested on Chrome Status. Testing gate to be requested later.
"Unimportant" cross origin frames means they are cross-origin, visible but use non-large proportion (<75%) of page's visible area and have not received a user gesture. All 3 conditions should be met. The criteria are too long so we use "unimportant" concept here.
This intervention is spec-compliant. The spec mentions "the SetTimeout/SetInterval API does not guarantee that timers will run exactly on schedule. Delays due to CPU load, other tasks, etc, are to be expected". The wait length of time is implementation-defined, "which is intended to allow user agents to pad timeouts as needed to optimize the power usage of the device". In Safari, DOM timers of non-interacted cross origin frames are aligned to 30ms after reaching max nesting level (>=5). In Firefox, all DOM timers of frames (both same origin and cross origin) are aligned to 16ms. See details in "Interoperability and Compatibility Risks", "Safari views", "Firefox views".
I believe the question Mike asked is not if this is spec compliant, but if the specifics of this should be more tightly specified, given that both WebKit and Chromium find a similar intervention useful.
Right - that's my question. I also asked how similar this change is to whatever Safari implements - do they also align wakeups of JS timers for cross-origin, < 75% of viewport, frames that haven't yet received a user gesture? You previously wrote "non-interacted cross origin frames" for WebKit. Is there also a viewport condition?
I believe the question Mike asked is not if this is spec compliant, but if the specifics of this should be more tightly specified, given that both WebKit and Chromium find a similar intervention useful.
Thank you for the answers Etienne. Once the Testing bit has been
requested, I'm happy to give an LGTM.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
LGTM2
LGTM2
LGTM1