Intent to Experiment: Remove clamping of setTimeout(..., 0)

148 views
Skip to first unread message

Lin, Wanming

unread,
Mar 31, 2022, 9:48:55 PMMar 31
to blin...@chromium.org

Contact emails

wanmi...@intel.com

Explainer

None

Specification

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers

Summary

Calls to setTimeout(..., 0) were previously clamped to a 1 ms timeout, instead of resulting in a callback as soon as possible. This clamping is being removed. To get the old behavior, use setTimeout(..., 1) instead.



Blink component

Blink>Scheduling

TAG review



TAG review status

Not applicable

Risks


This is a web standards compliant feature, but it may change task ordering on a web page, leading to unexpected behavior on sites that are dependent on a certain ordering in some way. It also may affect sites with a lot of setTimeout()

with a timeout of 0ms usage, e.g. increasing CPU load.

Interoperability and Compatibility



Gecko: Shipped/Shipping

WebKit: Shipped/Shipping (https://bugs.webkit.org/show_bug.cgi?id=221124)

Web developers: No signals

Other signals:

WebView Application Risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?


Yes, same as “Risks” section.

Goals for experimentation

Our goals are to determine the extent of breakage caused by this feature to determine if it is safe to ship and to ensure we performance metrics don't regress, e.g. core web vitals. We've previously experimented at 75% on Canary/Dev/Beta without capturing any issues, and we would like to experiment on Stable to analyze the impact on the broader population.



Reason this experiment is being extended



Ongoing technical constraints



Debuggability



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

No

Is this feature fully tested by web-platform-tests?

No

Flag name

SetTimeoutWithoutClamp

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=402694

Estimated milestones

OriginTrial desktop last

102

OriginTrial desktop first

101

DevTrial on desktop

97

 

OriginTrial android last

102

OriginTrial android first

101

DevTrial on android

97

 

DevTrial on iOS

97

We plan to do a 1% Stable experiment for M101 and M102 stable.

Link to Intent to Ship

https://groups.google.com/a/chromium.org/g/blink-dev/c/HKPTp7C1LwY

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/4889002157015040

This intent message was generated by Chrome Platform Status.

 

Yoav Weiss

unread,
Mar 31, 2022, 10:22:10 PMMar 31
to Lin, Wanming, blin...@chromium.org
LGTM to experiment on 1% Stable with this, M101-M102 (inclusive)

Do you have someone from the Google side to help you with setting up the internal parts of the experiment? 

On Fri, Apr 1, 2022 at 3:48 AM Lin, Wanming <wanmi...@intel.com> wrote:

Contact emails

wanmi...@intel.com

Explainer

None

Specification

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers

Summary

Calls to setTimeout(..., 0) were previously clamped to a 1 ms timeout, instead of resulting in a callback as soon as possible. This clamping is being removed. To get the old behavior, use setTimeout(..., 1) instead.



Blink component

Blink>Scheduling

TAG review



TAG review status

Not applicable

Risks


This is a web standards compliant feature, but it may change task ordering on a web page, leading to unexpected behavior on sites that are dependent on a certain ordering in some way. It also may affect sites with a lot of setTimeout()

with a timeout of 0ms usage, e.g. increasing CPU load.

Interoperability and Compatibility



Gecko: Shipped/Shipping

Any links? Do you know if this is already shipping to users?
 
This seems very recent, so I'm guessing it has hit their shipping channels just yet..
 
--
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/SJ0PR11MB4894ACD972A47366896D1C7EFFE09%40SJ0PR11MB4894.namprd11.prod.outlook.com.

Wanming Lin

unread,
Mar 31, 2022, 10:34:42 PMMar 31
to blink-dev, yoav...@chromium.org, blin...@chromium.org, Lin, Wanming, shas...@google.com
Thanks Yoav, 


> Do you have someone from the Google side to help you with setting up the internal parts of the experiment? 

Scott is helping me on the experiment all the way.

Yoav Weiss

unread,
Mar 31, 2022, 10:41:56 PMMar 31
to Wanming Lin, blin...@chromium.org, Scott Haseley
On Fri, Apr 1, 2022 at 4:34 AM Wanming Lin <wanmi...@intel.com> wrote:
Thanks Yoav, 

> Do you have someone from the Google side to help you with setting up the internal parts of the experiment? 

Scott is helping me on the experiment all the way.

Awesome, hoping it sticks :)
Reply all
Reply to author
Forward
0 new messages