-
Notifications
You must be signed in to change notification settings - Fork 36
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
Make parsing faster #629
Comments
FWIW VSCode FPP uses ANTLR in a worker thread and posts a JSON version of the AST to the main process. This seems to be quite fast. It might be possible to use this ANTLR definition and generate Java code. Then post the Java code to our Scala context. It does mean two languages though... |
I also wonder if the real slowdown comes from the lexer rather than the parser. The parser's task is quite simple but the lexer needs to try to iteratively match regex together. There might be some better methods for lexing that is faster. Flex for example, does codegen from all the token rules into a character-by-character lexing state machine which seems to be quite fast. |
Based on this link one can profile scala code with the VisualVM profiler. Note last comment:
|
The parser combinator library that we use for FPP is easy to use and maintain, but the parsing is inefficient. We could speed up the F Prime build process by implementing an efficient parser.
Unfortunately there is no obvious choice for a faster parser:
The text was updated successfully, but these errors were encountered: