Groovy build very slow

Hi

I have a Groovy project with a one simple groovy script:

 
@Grab('mysql:mysql-connector-java:5.1.31')
@GrabConfig(systemClassLoader=true)
import groovy.sql.Sql

def sql = Sql.newInstance("jdbc:mysql://localhost:3306/test", "test","test", "com.mysql.jdbc.Driver")

sql.eachRow("select * from test where idtest = 1", { test ->
    println test.idtest + ' ' + test.testcol
})


I've added the mysql connector jar to the External Libraries (this took me a long time to figure out, and not convinced this is the best way to do it).

To build and run takes over 1min 30secs.  

I've increased the heap space but it didn't improve things.

What do I need to do to improve performance?

Thanks
Andrew

5 comments
Comment actions Permalink

You can Alt+Enter on Grab annotations to fetch and configure dependencies automatically.

Please provide the complete project that will reproduce the problem. Specify your OS, and IDEA versions, attach idea.log (https://intellij-support.jetbrains.com/entries/23352446) and build.log with debug info enabled.

0
Comment actions Permalink

Hi

I'm using 15.01 CE on Mac OSX El Capitan.

Requested files attached.

Regards
Andrew



Attachment(s):
build.log.zip
idea.log.zip
groovy.project.zip
0
Comment actions Permalink

/Volumes/DATA/agile-software-engineers/libraries/jars/mysql-connector-java-5.1.31-bin.jar  seems to be corrupted, try to replace it with the new working version.

0
Comment actions Permalink

Hi

Thanks for looking into this.  The code runs on my machine and connects to the database.  Possibly the file was corrupted when I created the zips.  In any case I used you tip to use ALT-ENTER to get the latest version of the jar and deleted the old version.  None of this made any difference, sitll a minute and a half to compile.

Regards
Andrew

0
Comment actions Permalink

Could you please attach build.log taken with the correct jar in classpath?

In addition, could you please take a couple of thread dumps of the build process during the lengthy compilation and attach them as well? You can use jstack for that (https://intellij-support.jetbrains.com/hc/en-us/articles/206827507-Getting-a-thread-dump-when-IDE-hangs-and-doesn-t-respond, but on build process (Launcher) instead of the IDE).

0

Please sign in to leave a comment.