The Parrot parser is based on Antlr 4 and has been the Groovy parser since Groovy 3.0.0. The following system properties tune parsing performance.
| Option | Description | Default | Version | Example |
|---|---|---|---|---|
groovy.parallel.parse |
Parse Groovy source files in parallel. |
|
3.0.5+ |
-Dgroovy.parallel.parse=false |
groovy.antlr4.cache.threshold |
How many source files are parsed before the parser DFA cache is replaced. The value is a count of files, not of tokens. |
|
3.0.5+ |
-Dgroovy.antlr4.cache.threshold=200 |
groovy.antlr4.cache.size |
Maximum number of DFA states retained in the parser cache. Crossing the ceiling replaces the cache. The default scales with the maximum heap: about 32 states per megabyte, and never less than 20,000 or more than 500,000. |
heap-scaled |
6.0.0+ |
-Dgroovy.antlr4.cache.size=100000 |
groovy.antlr4.sll.threshold |
The parser tries SLL prediction and falls back to LL if SLL fails. SLL is faster and less powerful, and it fails more often as the token count grows. When the token count is greater than this threshold, SLL is skipped and LL is used directly. |
|
3.0.9+ |
-Dgroovy.antlr4.sll.threshold=1000 |
groovy.antlr4.clear.lexer.dfa.cache |
When |
|
3.0.9+ |
-Dgroovy.antlr4.clear.lexer.dfa.cache=true |