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

feat(snapshots): incremental snapshots #5213

Merged
merged 1 commit into from Jan 29, 2021
Merged

feat(snapshots): incremental snapshots #5213

merged 1 commit into from Jan 29, 2021

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Jan 29, 2021

  • Switch from html to json ml format.
  • Allow node reuse between snapshots with [nSnapshotsBefore, nodeWithIndexM].
  • Service worker now lazily serializes snapshot chunks into a single html.

This decreases total snapshot size on random scripts ~10x.
This also decreases snapshot collecting time on mostly static pages to ~0.3ms.

Unfortunate downside for now is that we have to intercept
Element.prototype.attachShadow to invalidate nodes. This
also temporary breaks scroll restoration. Needs more research.

- Switch from html to json ml format.
- Allow node reuse between snapshots with `[nSnapshotsBefore, nodeWithIndexM]`.
- Service worker now lazily serializes snapshot chunks into a single html.

This decreases total snapshot size on random scripts ~10x.
This also decreases snapshot collecting time on mostly static pages to ~0.3ms.

Unfortunate downside for now is that we have to intercept
`Element.prototype.attachShadow` to invalidate nodes. This
also temporary breaks scroll restoration. Needs more research.
@dgozman dgozman merged commit 69ca308 into microsoft:master Jan 29, 2021
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.

None yet

2 participants