-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
zeed dom is collecting all JSX elements it ever used in USED_JSX
#2
Comments
Hi @floriankrueger I'll take a look. Thanks for investigating. |
I made a quick change, to improve the speed of the |
Thank you for the intermediate fix! It'll improve the linear search a lot which should solve the reason for the performance issues that we were experiencing. One concern remains even after the fix: Renders of previous documents are influencing upcoming documents. So the |
I agree, this is bad design. I'll fix it but will need some time to do it well. |
I removed the hack around Change: b88ae22 |
This is amazing, thank you so much for the time! |
No problem, thanks for pointing on the error and testing to make zeed-dom finally become a "Happy DOM" ;) |
While digging into this issue with tiptap, my colleague @jcarvalho and I found the global variable
USED_JSX
to be the issue. Even serializing a simple document to HTML in a loop would quickly become slower and slower until it takes over a second to finish.Memory was not an issue in our tests since the contents of
USED_JSX
where just the same elements over and over again so node itself could easily optimize that.tiptap issue #2148 lists an example on how to make this happen. Would be great if you could give an estimate on how easily this might be fixable. I tried switching it from a global var to a parameter yesterday but there are so many points where I needed to pass the parameter to, and some of them were getters or setters, so that wasn't achievable.
The text was updated successfully, but these errors were encountered: