Sorry if it is trivial but bc you asked shell command and if meant the "java script.java" no compile way: even that is fast, but if you run in a shell script loop thousand times, then do not forget to compile.
Very fast. And yes, it can be used for small apps too. With java problem now is not the performance but how verbose still it is. However, it's much better since Java 17 and each release make it even more compact and direct. Like in this release we got much better built-in support for JSON.
JIT + hotspot optimization makes JVM pretty fast, but warmup time is usually the problem. However it does look like they’re addressing startup time with improvements in this release:
It's really refreshing to see the pace of Java development pick up so much over the past few years.
The last few years of server-side has been on Kotlin for me, however, modern Java is looking more and more like anything I'd need in a language.
Yah but why? The things it was good at doesn’t really matter nearly as much post AI.
I'm not a Java person, but I'm curious how fast it is nowadays, and also the startup time. Can it be used to write shell commands with, for example?
Sorry if it is trivial but bc you asked shell command and if meant the "java script.java" no compile way: even that is fast, but if you run in a shell script loop thousand times, then do not forget to compile.
Very fast. And yes, it can be used for small apps too. With java problem now is not the performance but how verbose still it is. However, it's much better since Java 17 and each release make it even more compact and direct. Like in this release we got much better built-in support for JSON.
I'm using JDK 21 (old) and the startup time is sub-second for small programs.
That’s not the flex you seem to think
It wasn't meant to be a flex.
JIT + hotspot optimization makes JVM pretty fast, but warmup time is usually the problem. However it does look like they’re addressing startup time with improvements in this release:
- AOT compilation: https://openjdk.org/jeps/544 - ~100ms startup for ZGC: https://openjdk.org/jeps/545
Every time I try, I keep going back to .NET, which has been optimising for faster startup time.
Almost all Java benchmarks are for the "steady state" after half an hour of warm up time.
Doesn't Java have an AOT solution too? Is it not ready for prime time?
It is, but people like to bash Java ;)
JEP 540: Simple JSON API
Be strict in what you produce, be lenient in what you accept. Grr.