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

chore: remove anchor node from each block items #11836

Merged
merged 12 commits into from
Jun 20, 2024
Merged

chore: remove anchor node from each block items #11836

merged 12 commits into from
Jun 20, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented May 29, 2024

This PR aims to reduce the DOM complexity of our each blocks. Each entry in the each block gets a text node anchor, which adds significant DOM overhead in all browsers. Removing this gains almost 40-50% performance improvement in some benchmarks when it comes to cleardown impact of big each blocks. Conversely, it also impacts benchmarks too that track this. It turns out that adding lots of text node anchors isn't cheap at all, it's actually quite expensive, so what if we could avoid it entirely?

This PR aims to do that, but I've likely missed some use-cases that we might need to address, even if the test all pass.

Copy link

changeset-bot bot commented May 29, 2024

🦋 Changeset detected

Latest commit: 15af7b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@trueadm trueadm changed the title fix: improve each block runtime heuristics be removing anchor text node chore: improve each block runtime heuristics be removing anchor text node May 30, 2024
@Conduitry Conduitry changed the title chore: improve each block runtime heuristics be removing anchor text node chore: remove anchor node from each block items Jun 20, 2024
@trueadm trueadm merged commit 361d33e into main Jun 20, 2024
9 checks passed
@trueadm trueadm deleted the improve-each branch June 20, 2024 20:17
FoHoOV pushed a commit to FoHoOV/svelte that referenced this pull request Jun 27, 2024
* fix: improve each block runtime heuristics be removing anchor text node

* change message

* conflict

* merge

* fix bug

* Update .changeset/stale-nails-listen.md

---------

Co-authored-by: Rich Harris <[email protected]>
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.

2 participants