r/java • • Jun 10 '24

[deleted by user]

[removed]

615 Upvotes

594 comments sorted by

View all comments

Show parent comment

0

u/GeneratedUsername5 Jun 11 '24

Unfortunately yes.

Don't just belive what they say in docs, try to perftest yourself. I tried to perftest Javalin, a Kotlin-wrapper around Jetty (pure-java lib). Here you can see "almost no runtime overhead" or "minimal overhead"

https://imgur.com/zwIsWFn

Top CPU hotspot - kotlin intrinsic for checking parameters for null. It took 7(!) times longer to check for nulls, than to route a request, considering routing is already poorly optimized.

So, yes, if kotlin devs meant half-dead server with 1 RPM, then overhead is minimal. For performance goals it very much isn't.

P.S. I like how they try to convince that the checks are compiler-only and then immediately acknowledge that there are runtime checks.