-
Notifications
You must be signed in to change notification settings - Fork 171
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
Why not just use antlr to impl the interpretor? #935
Comments
One reason would be because it's likely much slower, see:
https://tomassetti.me/improving-the-performance-of-an-antlr-parser/
https://groups.google.com/g/antlr-discussion/c/74aPR8wjXe4 We care a lot about performance as we use Jinjava to server-side render pages for HubSpot's CMS. |
Make sense, thanks! |
I'm still a little bit curious that, if ANTLR is slow, it should be considered as a compile time behavior and should impact on the bootstrap time, not the runtime performance, or the |
I mean, parsing should be a one time effort, after that, the AST could be reused for further rendering, just like what the |
Jinjava does have a compiling stage, but we need that to be fast because we parsed from string templates and use them a single time while that AST is in memory very often. Sometimes we reuse the parsed AST over-and-over, but most jinjava usage is parse and immediately interpret so we need that to be fast |
I found currently it's a handwriting parser
The text was updated successfully, but these errors were encountered: