If you find the performance issue is gone when you disable the Parrot parser with `-Dgroovy.antlr4=false`, you can try to enable the Parrot parser again and apply `-Dgroovy.antlr4.cache.threshold=200` shown as follows.
``` compileGroovy { groovyOptions.fork = true groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4.cache.threshold=200"] // you can try to increase the threshold if your project contains many Groovy source files. } ``` The greater the value of threshold is, the longer the cache will be reused(i.e. not be cleared), but it will require bigger JVM heap. Note: antlr4 recommends never to clear the cache for better performance, but Parrot parser will clear the cache to avoid OOME when threshold reaches. Cheers, Daniel.Sun ----- Apache Groovy committer & PMC member Blog: http://blog.sunlan.me Twitter: @daniel_sun -- Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html