News for hackers. Stuff that matters.
Re:Java 21 makes me like Java again by troupo on Sunday September 17, 2023 @01:02AM (#37541679)
Java's build times are very fast. Java's build tools are anything but. And I'm surprised no one is doing anything about it.
Re:Java 21 makes me like Java again by palata on Sunday September 17, 2023 @01:22AM (#37541782)
That's because everybody is busy shipping full web browsers with a hard-coded website inside and calling that an "app".
Re:Java 21 makes me like Java again by lenkite on Sunday September 17, 2023 @03:14AM (#37542345)
If you are leveraging Maven, use mvnd during development: https://github.com/apache/maven-mvnd
Re:Java 21 makes me like Java again by kaba0 on Sunday September 17, 2023 @05:57AM (#37543299)
Gradle, when the daemon is runnning is very fast, people just often fck up their build scripts to include config-time run functionality, which is just all around a stupid thing to do.

It only ever runs tasks that actually have to be run, has integration with javac, can work in parallel, and even has cross-company build caches if needed.

Also don't forget that Java can do hot reloads with the debugger, or with tools like JRebel. Certain frameworks support it 100% and it will be much much faster than whatever go does.

Re:Java 21 makes me like Java again by troupo on Sunday September 17, 2023 @06:27AM (#37543506)
I've never seen Gradle run fast, even with the daemon running. Gradle itself can take multiple seconds to startup. God knows what it's doing.
Re:Java 21 makes me like Java again by MrBuddyCasino on Sunday September 17, 2023 @10:06AM (#37545212)
Gradle is steaming pile of garbage. But since the zoomers are allergic to XML, Maven (actually fast) is slowly dying.
Re:Java 21 makes me like Java again by kaba0 on Sunday September 17, 2023 @11:35AM (#37546164)
Gradle is much faster than maven as it can properly parallelize the workloads. Sure, it won’t be visible on a hello world, though.
Re:Java 21 makes me like Java again by MrBuddyCasino on Sunday September 17, 2023 @11:56AM (#37546435)
Has never been the case in my many years of using it. Hundreds of MB permanent RAM usage for the daemon (which it wouldn’t require if it was properly designed), everything taking well above 10s. None of this has ever been an issue with Maven.
Re:Java 21 makes me like Java again by kaba0 on Sunday September 17, 2023 @12:47PM (#37547013)
You can disable the daemon in gradle if you don’t want it.
Re:Java 21 makes me like Java again by troupo on Sunday September 17, 2023 @02:04PM (#37547753)
I've never seen gradle be faster than Maven. I have no idea what purose its daemon serves or its promise to "parallelize workloads". Which workloads? Its purpose is to build the project, fast. It spends about a magnitude of time more just trying to start up, even with daemon running.
Re:Java 21 makes me like Java again by throwaway2037 on Monday September 18, 2023 @05:14AM (#37553949)
There seems to be some disagreement to your statement. Can you provide some concrete examples?
Re:Java 21 makes me like Java again by kaba0 on Monday September 18, 2023 @06:45AM (#37554493)
Re:Java 21 makes me like Java again by Phelinofist on Sunday September 17, 2023 @01:45PM (#37547585)
We are in the process of switching to Gradle at work and I'm not sure I like it. I used Gradle when building some OSS projects, but my experience wasn't that great.
Re:Java 21 makes me like Java again by kaba0 on Sunday September 17, 2023 @06:04PM (#37549767)
Just make sure that whoever writes the majority of the build file actually understands gradle, at least its fundamentals. It really is not hard, and afterwards it is a really great tool that can significantly improve compile/CI times.
Re:Java 21 makes me like Java again by troupo on Monday September 18, 2023 @05:50AM (#37554154)
The tool whose main purpose is to build stuff should not demand "understand gradle at least fundamentals so that afterwards you can probable possibly improve times".

Why isn't it fast out of the box? Why does the simple "provide a list of deps, provide a list of paths, build" take so darn long? Because Gradle is a great tool or something?

Don't forget that it's also already at version 8, where each change is mostly incompatible, bizarre and inexplicable breakages between versions, often due to meaningless option renames. Imagine if they spent all that effort on actually making it a great tool.

Re:Java 21 makes me like Java again by SpaghettiCthulu on Sunday September 17, 2023 @05:16PM (#37549416)
Gradle is anything but fast
Re:Java 21 makes me like Java again by throwaway2037 on Monday September 18, 2023 @05:13AM (#37553946)
If you avoid pre-Java 11 modules in Apache Maven, it is very fast to build. Plus, IntelliJ is auto-magically incremental build. Can you give some specific examples where Java build tools are slow? Most Java developers spend their whole day in an IDE that is doing incremental build, jumping in and out of a debugger to fix bugs or broken unit tests.
Re:Java 21 makes me like Java again by troupo on Monday September 18, 2023 @05:52AM (#37554169)
Maven is okay-ish, Gradle is an abomination. Incremental compilation doesn't always work, and the fact that the build tools often spends a magnitude or more time just starting up than actually doing useful work is inexcusable.