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

Performance issue when i rendering a big page #663

Open
Sotyoyo opened this issue Jun 24, 2024 · 1 comment
Open

Performance issue when i rendering a big page #663

Sotyoyo opened this issue Jun 24, 2024 · 1 comment

Comments

@Sotyoyo
Copy link

Sotyoyo commented Jun 24, 2024

Problem:
Now, when i generate a page which contains of hundreds of nodes (even more), whenever i start to copy some nodes on craftJS or setting new props in a node, i will wait for maybe 5-10 seconds.

Why:
I think it is because of craftJS uses immer.js and listen on the state.nodes, even a tinny change will cause the whole Frame.tsx re-render from top to end, it seems like a recursion. And also, these events will connect again during this rendering.

Question:
I am totally agree that it is a open-source project and us should not raise any requirements. But i still want to ask how can i avoid the biggest rendering cost or if we can re-build the structure to improve that ?

My idea:
I am impacted from React Fiber, and if we can also build two tree (one memory, one current), and then diff it so that we just need to care about those changing part?

@Sotyoyo
Copy link
Author

Sotyoyo commented Jun 24, 2024

Problem:
Now, when i generate a page which contains of hundreds of nodes (even more), whenever i start to copy some nodes on craftJS or setting new props in a node, i will wait for maybe 5-10 seconds.

Why:
I think it is because of craftJS uses immer.js and listen on the state.nodes, even a tinny change will cause the whole Frame.tsx re-render from top to end, it seems like a recursion. And also, these events will connect again during this rendering.

Question:
I am totally agree that it is a open-source project and us should not raise any requirements. But i still want to ask how can i avoid the biggest rendering cost or if we can re-build the structure to improve that ?

My idea:
I am impacted from React Fiber, and if we can also build two tree (one memory, one current), and then diff it so that we just need to care about those changing part?

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

No branches or pull requests

1 participant