-
Notifications
You must be signed in to change notification settings - Fork 76
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
Application.renderToString performance #375
Comments
What do you propose? We use |
I will need to dig deeper into the code to come up with a possible solution. However, some tentative ideas may include either detecting pending fetches without calling renderToString, or call it only once for each node in the tree and keep the result. |
That's not quite right, BTW - |
Can the renderToString result be buffered during detecting so if there is no new fetches the buffered result can be used instead of making another call of renderToString? Also, per my test, the diagnositics look like this when the render is finished: While all the data in testStore1 is local and do not require remote fetch. Why it is marked 'PENDING' and therefore triggers a new cycle? |
I am experiencing the same. |
I am building an isomorphic app upon marty and I noticed that Application.renderToString is not performing well and can easily take hundreds of milliseconds for simple pages.
By investigating the source code I found out that it was because in the internal helper function waitForFetches in renderToString.js file calls React.renderToString for every cycle it hits detecting unfinished fetches. Even if there are absolutely no fetches the React.renderToString function is called at least twice, and for every fetch one more redundant rendering is made even if the data is already local. React.renderToString is VERY expensive and calling it multiple times in one request can easily eat up cpu power.
Now I understand that 0.10 is the final major release for marty. But I really hope this problem can be fixed and the redundant renderings can be removed.
Thanks for the great job!
The text was updated successfully, but these errors were encountered: