Conversation

Replying to
From what I recall of Java, the JIT and GC are highly configurable and even entirely different implementations can be swapped in/out. So, perhaps with no adjustments JS might outperform in certain cases.
1
1
Replying to
These are all good questions. I'd say that lack of sane defaults overall is why I don't like Java anymore. It's definitely not designed to rock the simple hello world cli out of the box. The last CLI I worked with would take 100's of ms from vm launch to hit my code.
1
1
Replying to
Other question, why doesn't the defaults change over time? Like oh, we've run for more than 20 seconds, lets switch our defaults from client to server defaults, or something like that.
1
Replying to and
At least in my brief testing, being able to switch this would be great:
Quote Tweet
Replying to @laffer1 and @seeteegee
I did manage to find: stackoverflow.com/questions/1491 But the only thing that made a big difference was: `-XX:TieredStopAtLevel=1`. It dropped overall runtime (signal-cli --help) from ~.95s to ~.86s, but the big drop was user time, from 1.7s to .85s. Still pretty terrible perf.
1
Replying to and
Java has historically tuned the runtime for long running server processes. It won't typically win a "helloworld" competition but will blow must other runtimes out of the water comparing peak performance. "helloworld" is fine for blog posts but what's your actual workload?
2
2
Build it into a native executable with the full standalone GraalVM instead of using JIT compilation with OpenJDK. OpenJDK isn't the only way to run Java and isn't at all efficient for short-lived processes. The JIT compiler is probably hurting you more than helping for this.
2
OpenJDK is only really optimized for long-lived processes no matter how you configure it. Android's Kotlin/Java implementation (ART) only really uses JIT to bootstrap AOT. It starts with interpreter/JIT and gradually moves to everything being AOT compiled guided by JIT profiles.
1