-
Notifications
You must be signed in to change notification settings - Fork 34
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
Exponential rendering time using createRichTextObjectResolver
#374
Comments
Sorry to hear that @Piwaii, Can you provide the data you used for the testing? I am interested in the complexity of the input. We are currently working on the replacement for rich text resolution to unify the capabilities. Would you be willing to try to render your data using Ritch text resolver? An example of use could be seen in the README of the linked repository, or on https://github.com/Simply007/kontent-starter-corporate-next-js/blob/main/src/components/RichText.js. |
Indeed this new lib is very efficient :
we will definitely follow this new repo :) thank you very much @Simply007 |
Thanks for sharing the result! It looks awesome. Parsing seems very efficient. Have you just parsed the input, or also used the resolution library (i,e, linked https://www.npmjs.com/package/@portabletext/react)? |
We measured only the parsing |
This is great - thank you. Is there an example of this using TypeScript? Adds an extra layer of complexity :-p |
I'm looking into implementing a simpler (RegEx & replace) based solution in this SDK as a replacement for the browser / parse5 parser that this SDK currently uses. I've implemented it in another project already and saw a huge improvement in speed.. what took 1 minute using the node.js parser now takes under a second in new implementation. I'm hoping to look into this in near future, but can't promise anything just yet ;) |
Brief bug description
We are rendering a big article with markup (56000 characters) using
createRichTextObjectResolver
and it takes more than 25 seconds to answer.Repro steps
createRichTextObjectResolver
Expected behavior
Event if it's a big article, it should render in a reasonable time (avoiding possible timeouts)
Test environment
Additional context
We tested it in a little project (repo can be shared on demand) and the results are these :
The text was updated successfully, but these errors were encountered: