This repository was archived by the owner on Jul 28, 2023. It is now read-only.
🎨 Switch toVdom from array iteration to createTreeWalker#103
Merged
luisherranz merged 16 commits intomain-wp-directives-pluginfrom Apr 19, 2023
Merged
🎨 Switch toVdom from array iteration to createTreeWalker#103luisherranz merged 16 commits intomain-wp-directives-pluginfrom
luisherranz merged 16 commits intomain-wp-directives-pluginfrom
Conversation
23 tasks
13 tasks
Member
Author
|
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 🙂 |
Contributor
|
I loved the explanation 😁 And it seems faster, so I'm fine with pursuing this approach. |
…create-tree-walker
…create-tree-walker
Member
Author
|
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! 🎉 |
22 tasks
DAreRodz
approved these changes
Apr 18, 2023
Collaborator
DAreRodz
left a comment
There was a problem hiding this comment.
I think it's perfect, @luisherranz. 👌 Feel free to merge it.
Member
Author
|
Thanks David! |
This file contains hidden or 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
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 theforwe 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 🙂