The Parrot parser is based on antlr4 and introduced since Groovy 3.0.0. It provides the following options to tune parsing performance:
Option | Description | Default | Version | Example |
---|---|---|---|---|
groovy.parallel.parse |
Parsing groovy source files in parallel. |
|
3.0.5+ |
-Dgroovy.parallel.parse=true |
groovy.antlr4.cache.threshold |
antlr4 relies on DFA cache heavily for better performance, so antlr4 will not clear DFA cache, thus OutOfMemoryError will probably occur. Groovy trades off parsing performance and memory usage, when the count of Groovy source files parsed hits the cache threshold, the DFA cache will be cleared. Note: |
|
3.0.5+ |
-Dgroovy.antlr4.cache.threshold=200 |
groovy.antlr4.sll.threshold |
Parrot parser will try SLL mode and then try LL mode if SLL failed. But the more tokens to parse, the more likely SLL will fail. If SLL threshold hits, SLL will be skipped. Setting the threshold to |
|
3.0.9+ |
-Dgroovy.antlr4.sll.threshold=1000 |
groovy.antlr4.clear.lexer.dfa.cache |
Clear the DFA cache for lexer. The DFA cache for lexer is always small and important for parsing performance, so it’s strongly recommended to leave it as it is until OutOfMemoryError will truly occur |
|
3.0.9+ |
-Dgroovy.antlr4.clear.lexer.dfa.cache=true |