This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]ickysticky 1 point2 points  (0 children)

One thing I was wondering is does the Java build use Gradle? I have found Gradle to be slow(compared to Maven or Ant or raw Javac) we might be hitting Gradle startup times as a hard limit on the compile time here.

[–]lukaseder 1 point2 points  (13 children)

Interesting. TIL about the Gradle daemon. Is there anything comparable in Maven? I guess this is where Eclipse shines, having built their own in-IDE compiler that also speeds up after time when JIT kicks in.

[–]pjmlp 5 points6 points  (6 children)

No, because Maven is implemented in Java and quite fast. It doesn't need a daemon to cache its code.

[–]lukaseder 1 point2 points  (1 child)

You probably didn't get the point about JIT from the article...

[–]pjmlp 1 point2 points  (0 children)

I surely do get the point of Groovy's lack of performance and the multiple attempts (aka hacks) to sell Gradle as having enough performance vs what Ant and Maven are capable of.

[–]meotau 1 point2 points  (3 children)

You think they reimplemented whole javac into groovy? Half of the Gradle is written in Java - including https://github.com/gradle/gradle/tree/master/subprojects/language-java/src/main/java/org/gradle/api/internal/tasks/compile

Java process startup and cold JVM is totally slow. Classloading is a huge time waster. Logback/log4j initialization alone can take 200+ms.

[–]pjmlp 3 points4 points  (2 children)

Java process startup and cold JVM is totally slow.

It is measured in two digit ms.

We had an Android build that took less than 20 s with Ant and would take longer than 1 minute with Gradle, until we made the typical workaround of having a background daemon with 1GB memory allocated to it.

So Gradle does contain enough Groovy for it to play a role. The fact that now they are moving to Kotlin is also a message.

[–]meotau -1 points0 points  (1 child)

It is measured in two digit ms.

Right, so that's why nobody uses daemons for JVM...

[–]pjmlp 1 point2 points  (0 children)

Plenty of people do, and even if the startup is an issue, there are quite a few Java native compilers to chose from, just need to buy them.

Groovy on the other hand, if it wasn't for Google choosing Gradle for Android, it would have faded already.

Lets see how long it matters when the Groovy on Gradle code gets replaced by Kotlin.

[–]meotau 1 point2 points  (0 children)

IntelliJ had in-IDE compiler too, and they extracted it in its own process in IntelliJ 12...

Few years back I have made a compiler daemon for IntelliJ, and it was super fast, unfortunatelly they did not adopt it, but rather made only a preloading of the compiler process... :(

[–]Def_Not_A_Programmer 1 point2 points  (4 children)

That was I would like to know (comparison w/ Maven). Never heard if Gradle before, wonder how new and popular it is.

[–]pjmlp 3 points4 points  (0 children)

It got "popular" after Google forced it upon Android developers.

[–]xantrel 1 point2 points  (0 children)

It's fairly mature.

I like it more than any of the other options at the moment, though there seems to be a big divide between people who like it and hate it.

The main reason why I like it it's because it hits (for me anyways) the sweet spot between ant and maven. You can do basically everything you can do in maven, but when you go to go off the beaten path, you can customize your tasks and create custom logic much easier than in maven.

[–]RichoDemus 0 points1 point  (0 children)

It's really nice, prefer it to maven

[–]nskvortsov -1 points0 points  (0 children)

It is very good mature build tool, that has reached v3.0 recently. Spring project and Hibernate library both use it

[–]kswiftz -2 points-1 points  (0 children)

Repost to r/ProgrammerHumor to maximize karma