Re: GSP generation, Groovy 4 slower than Groovy 3?

Daniel Sun <[email protected]>
Newsgroups gmane.comp.lang.groovy.devel
Message-ID <[email protected]>
Hi Gianluca,

   Groovy 4 enables indy by default. It's slower to run for the first time because the initialization for invokedynamic is quite expensive. ( See also: https://bugs.openjdk.org/browse/JDK-8278540 )

   It ususally gains best performance when the methods are invoked for 10000+ times.

   BTW, Jochen proposed some optimization for current design of indy, the performance for the first runs will be much better when the optimization is done.

Cheers,
Daniel Sun

On 2025/09/16 12:18:41 Gianluca Sartori wrote:
> Hi folks,
> 
> we have started porting Dueuno to Grails 7/Groovy 4. We have a
> stress-test that generates a big table (200 columns x 100 rows) with
> GSP (we are doing server-side rendering).
> 
> I'm reporting the tests below. Is there something we can do to get
> back the performances we had with Grails 6/Groovy 3?
> 
> Even with INDY turned off we are almost 1sec slower on the tests, more
> than 2x slower on normal pages:
> 
> Grails 7/Groovy 4
> Page 1 - TRANSITION rendered in 185ms
> Page 2 - TRANSITION rendered in 453ms
> 
> Grails 6/Groovy 3
> Page 1 - TRANSITION rendered in 83ms
> Page 2 - TRANSITION rendered in 280ms
> 
> TESTS
> ======
> Same URL (Table stress-test), 4 requests after 3 warmup requests (not
> shown, cold-running the app from intelliJ), measuring the Grails
> render() execution time.
> 
> From slower to faster:
> 
> Grails 7 - Indy ON
> TRANSITION rendered in 4807ms
> TRANSITION rendered in 4779ms
> TRANSITION rendered in 4660ms
> TRANSITION rendered in 4699ms
> 
> Grails 7 - Indy OFF
> tasks.withType(GroovyCompile) {
>     groovyOptions.optimizationOptions.indy = false
> }
> TRANSITION rendered in 3660ms
> TRANSITION rendered in 3442ms
> TRANSITION rendered in 3510ms
> TRANSITION rendered in 3700ms
> 
> Grails 6
> TRANSITION rendered in 2853ms
> TRANSITION rendered in 2864ms
> TRANSITION rendered in 2734ms
> TRANSITION rendered in 2800ms
> 
> Gianluca Sartori
> --
> https://dueuno.com
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.