Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance control of embedded content #911

Conversation

nishitha-burman
Copy link
Contributor

First draft of explainer for performance control of embedded content.

Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
Performance control of embedded content/explainer.md Outdated Show resolved Hide resolved
| **C: Globals**<br>**Description:** Overall media and system resource usage constraints. | **- Cumulative resource consumption limits per interaction:**<br>* Caps on total media usage. No more than a total of X.<br>* Limits on iframe count. No more than a total of 10.<br>* Limits of iframe depth. No more than a depth of 10.<br>* CPU usage before first interaction: XMB. | - Report violations via Reporting API.<br>- Do not load media at all. <br>- Do not load iframes that surpass the depth. |
| **D: Script**<br>**Description:** Strict JavaScript restrictions. | **-Additional JS limits:**<br>* Long tasks in the main thread.<br>* High CPU usage.<br>* Workers with long tasks that exceed Xms.<br> | - Report violations via Reporting API.<br>- Stopping JavaScript if [in the background]. |

### Discussion of different categories
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed


#### Global budgets and side-channel attacks
The criteria proposed in this document includes budgets which are shared globally across documents. This could allow for documents to learn things about cross-origin documents, as described in the [Never Slow Mode explainer](https://github.com/slightlyoff/never_slow_mode?tab=readme-ov-file#global-limits). We consider the same alternatives as NSM as viable for this proposal:
* Require CORS
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with Alison - I don't think we should be referencing the NSM doc like this, we should take the contents we care about from it instead.

| ------------- | -------- | ------------------- |
| **A: Basic**<br>**Description**: Basic web development best practices that are scenario-agnostic. | **- Text resources must be compressed** (HTML, CSS, JS, JSON).<br> - **Unzipped assets are flagged.**<br> - **Oversized assets are flagged:**<br>* Assets larger than ?KB embedded via `data:...` URLs.<br>* Image files larger than ?KB served in last generation formats.<br> * Web fonts that are larger than ?KB. | - Reporting violations via Reporting API.<br> - Assets not rendered.<br> UI indicator to block out images that are too large. |
| **B: Early-script**<br>**Description**: JavaScript constraints during load to enhance performance and minimize impact on user experience before interaction begins. | **- JS limits:**<br>* Total limits on JS served prior to user interaction: ?MB<br>* Scripts must contain `content-length` headers<br>* No non-compositor thread animations (e.g. animated SVGs, loading spinners, etc.). | - Report violations via Reporting API.<br> - Loading of scripts that violate the limit are paused/blocked.<br> - Pause/disconnect animations that are not visible, interacted with. |
| **C: Globals**<br>**Description:** Overall media and system resource usage constraints. | **- Cumulative resource consumption limits per interaction:**<br>* Caps on total media usage. No more than a total of ?.<br>* Limits on iframe count. No more than a total of ?.<br>* Limits of iframe depth. No more than a depth of ?.<br>* CPU usage before first interaction: ?MB. | - Report violations via Reporting API.<br>- Do not load media at all. <br>- Do not load iframes that surpass the depth. |
Copy link

Choose a reason for hiding this comment

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

I noticed we talk about memory and CPU earlier but only CPU here. Is memory intentionally left out of the criteria section?

Copy link

Choose a reason for hiding this comment

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

Similar with battery actually, although I can understand why that is left out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some memory impacting features were captured in the "Basic" category, however the specifics of the criteria are still in progress so happy to discuss if you think a particular criteria should be included!

@aluhrs13 aluhrs13 merged commit efd1742 into MicrosoftEdge:main Jan 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants