"Fossies" - the Fresh Open Source Software Archive

Member "groovy-3.0.9/src/spec/doc/performance-guide.adoc" (3 Sep 2021, 2831 Bytes) of package /linux/misc/apache-groovy-src-3.0.9.zip:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming AsciiDoc format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

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


Parsing groovy source files in parallel.

false util Groovy 4.0.0




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: 0 means never clearing DFA cache, so requiring bigger JVM heap size. Or set a greater value, e.g. 200 to clear DFA cache if threshold hits. Note: the threshold specified is the count of groovy source files





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 0 means never trying SLL mode, which is not recommended at most cases because SLL is the fastest mode though SLL is less powerful than LL. Note: the threshold specified is the token count

-1 (disabled by default)




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 util OutOfMemoryError will truely occur