groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serega Sheypak <>
Subject Optimizing groovy performace
Date Sun, 10 Apr 2016 17:38:56 GMT
I'm working on groovy code performance optimization. I've used jvisualvm to
connect to running application and gather CPU samples. Samples say that
*org.codehaus.groovy.reflection.CachedMethod.inkove* takes the most CPU
time. I don't see any other application methods in samples.

What is the right way to dig into *CachedMethod.invoke* and understand what
code lines really give performance penalties?

Then I switched to groovy-indy version, now I see different results in

Probably, my problem a bit similar to this thread: Call site caching faster
than invokedynamic?

Most of CPU time spent in

I have a code that dynamically composes groovy script. Script template
looks this way:

def evaluateExpression(Map context){
    def user = context.user

where *%s* replaced with

user.attr1 == '1' || user.attr2 == '2' || user.attr3 = '3'

There is a set (20 in total) of replacements have taken from Databases. The
code gets replacements from DB, creates GroovyScript and evaluates it. I
suppose the bottleneck is in the script execution. What is the right way to
fix it?

View raw message