Groovy performance on Linux machine

0

I have a problem when I start Groovy on one of my Linux machines - it takes about 30 seconds to execute very simple command:

groovy -e ""

if I run strace on it, here is what I see where it stops and waits:

mprotect(0x7fae284e0000, 4096, PROT_NONE) = 0
clone(child_stack=0x7fae285dfff0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7fae285e09d0, tls=0x7fae285e0700, child_tidptr=0x7fae285e09d0) = 62660
futex(0x7fae285e09d0, FUTEX_WAIT, 62660, NULL <unfinished ...>

Is there a way to figure out what it's waiting for and why and how to fix it?

I am running Red Hat 6.3, Groovy Version: 2.2.1 JVM: 1.7.0_25 Vendor: Oracle Corporation OS: Linux

And here is time command:

bin$ time groovy -e ""

real 0m22.255s user 0m26.875s sys 0m2.064s

Roman Goyenko

Posted 2014-04-08T22:24:03.193

Reputation: 143

The latest version of Groovy being? It helps to have specific version numbers. Are you running the latest package for your distro, the latest stable release, the latest beta, the latest nightly? – heavyd – 2014-04-08T22:39:03.487

Groovy Version: 2.2.1 JVM: 1.7.0_25 Vendor: Oracle Corporation OS: Linux – Roman Goyenko – 2014-04-09T14:07:04.567

Answers

0

Reason of groovy's very long startup time (compared to other interpreted languages) is that is has to fire up a JVM for every groovy-command.

You might want to look into GroovyServ. What this does is running a daemon with a JVM in the background the first time you start it. Subsequent calls of groovyclient then use this JVM instead. It promises to be "10 to 20 times faster than regular Groovy".

plgruener

Posted 2014-04-08T22:24:03.193

Reputation: 1

I don't think it was the case since the same call works much faster on another server with similar hardware. And java runs faster as well, nowhere near 30 second delays. – Roman Goyenko – 2016-03-01T21:46:59.760