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

Support async compile and rendering to avoid event loop for large & complex templates #50

Open
alexewerlof opened this issue Mar 5, 2020 · 1 comment
Labels

Comments

@alexewerlof
Copy link
Owner

alexewerlof commented Mar 5, 2020

The synchronous render() method can occupy the event loop if the input is huge. We can't do much about it without adding lots of complexity or relying on Workers.
We could add a renderAsync() function that does the rendering work in chunks.
Also have a look at tokenization because that can block the event loop too.

@alexewerlof
Copy link
Owner Author

This could be achieved by passing an identity function (x => x) to the renderFnAsync() but with the current setup the code wouldn't look super intuitive. It would be better to add a option for a function that allows processing varNames and turning them into something that render*() would use in its interpolation algorithm.

@alexewerlof alexewerlof mentioned this issue Aug 15, 2020
@alexewerlof alexewerlof changed the title Support async rendering for performance Support async compile and rendering to avoid event loop for large & complex templates Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant