Skip to content

Conversation

@younisdev
Copy link
Contributor

Description

Updated chained JS timers throttling behaviour in Chrome 88, which impacts the performance for timers in inactive tabs with chrome throttling stages.

Motivation

This update clarifies the updated throttling behavior of JavaScript timers in Chrome 88, which impacts performance for timers in inactive taps. It ensures the reader is aware of chrome throttling stages.

Additional details

None.

Related issues and pull requests

Fixes #38988.

@younisdev younisdev requested a review from a team as a code owner April 7, 2025 16:58
@younisdev younisdev requested review from wbamberg and removed request for a team April 7, 2025 16:58
@github-actions github-actions bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Apr 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2025

Preview URLs

(comment last updated: 2025-04-17 10:29:09)

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

- **Minimal throttling**: Applies to timers when the page is visible, has made sound recently, or is otherwise considered active by Chrome. Timers run close to the requested interval.

- **Throttling**: Applies to timers when minimal throttle conditions are not met and any of these conditions are true:
- Chain count (timer invocations) is lower than 5.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Chain count" is I guess what's referred to earlier on in this page as "nesting", and it would be good to use consistent language.

Timers in this state are checked once per second, which may be batched together with other timers that have similar timeouts.

- **Intensive throttling**: Introduced in Chrome 88 (January 2021). Applies to timers when neither minimal throttling nor throttling conditions are met, and all of the following conditions are met:
- Chain count (timer invocations) is 5 or higher.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here.

@younisdev
Copy link
Contributor Author

Thanks for your PR!

No problem, just pushed the changes!

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thank you, @younisdev !

@wbamberg wbamberg merged commit e885349 into mdn:main Apr 17, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Heavy throttling of chained JS timers beginning in Chrome 88" should be mentioned

2 participants