This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
🎨 Switch toVdom from array iteration to createTreeWalker #103
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
luisherranz
changed the title
Switch from array (for loop) to createTreeWalker
Switch toVdom from array iteration to createTreeWalker
Nov 16, 2022
23 tasks
luisherranz
changed the title
Switch toVdom from array iteration to createTreeWalker
🎨 Switch toVdom from array iteration to createTreeWalker
Nov 21, 2022
13 tasks
I guess that the 5 heart reactions in the opening posts mean you all like it, so I'll clean it up, resolve the conflicts and prepare it for review 🙂 |
I loved the explanation 😁 And it seems faster, so I'm fine with pursuing this approach. |
…create-tree-walker
…create-tree-walker
I had to make a small adjustment to the algorithm and I added e2e tests (kudos to @DAreRodz for helping me with those). Both are explained in the video: https://www.loom.com/share/45610946048c43d28adafb59e681245f Ok. This is finally ready for review! 🎉 |
luisherranz
requested review from
DAreRodz,
michalczaplinski,
SantosGuillamot and
ockham
April 18, 2023 16:12
22 tasks
DAreRodz
approved these changes
Apr 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's perfect, @luisherranz. 👌 Feel free to merge it.
Thanks David! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have been testing
createTreeWalker
, and it is consistently faster than thefor
we are using now: 50% in Chrome and 15% in Firefox and Safari.This PR is not ready to merge yet. I have opened it up with my tests if anyone wants to do theirs as well. I have also recorded a video explaining what I have done so far:
I won't be able to continue with this PR in the next few days, so if anyone wants to, you can finish it: remove the tests, delete old code, etc. I haven't tested the algorithm with HTML comments either, so we would have to test that it works before merging it. We also have to start thinking about adding tests (unit and e2e), but maybe that can be done in another PR.
Thanks to @michalczaplinski for the HTML file generator 🙂