SetComponents is sometimes very slow
See original GitHub issueHi all We’re working on a newsletter app and are using grapesjs as the email editor with the newsletter preset plguin and some custom changes. We store the HTMLs in our database and I noticed that some templates take a very long time to load with the editor.setComponents method.
I tried to load the templates in the demo page through the import and while it loads almost instantly, I did notice a peculiar issue on the newsletter demo page ( https://grapesjs.com/demo-newsletter-editor.html ). If a component is selected before importing a HTML template it takes a lot longer to load (from 0.5s up to 5s).
With inserting some logs I’ve figured that the backbone set
method get’s called a lot more. Mostly ‘add’ models get duplicated, but there are also a lot of ‘change:style’ models. But I’m kind of at a loss here what is necessary and what not :S
Maybe figuring out why setComponents get’s a lot slower if a component is selected, could help me figure out why it is also slow in our project.
I’ve also noticed that this starts happening after release 0.14.40. Any help is greatly appreciated.
Issue Analytics
- State:
- Created 5 years ago
- Comments:24 (10 by maintainers)
Top GitHub Comments
This shows you how to find issues with performances https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/
The time now is OK. My problem was when parsing JSON 2 HTML. I forgot that have self closing tags like BR and my script generate
. Thanks for your support.