Any (objective?) performance comparisons between Kotlin and Groovy?


I’m looking for some benchmarks where Groovy and Kotlin perf is compared.

My assumption would be that Groovy with @CompileStatic and Kotlin would be pretty equivalent performance wise but it would be nice to see some actual numbers.

Kotlin performance in most cases is exactly the same as Java. Groovy even with @CompileStatic in most cases is slower due to additional runtime checks. I think, that the main point of difference is a Groovy Closure which is much more expensive than Kotlin lambda.
A personal experience: I was using Groovy for a few years before, but now I am moving all the codebase to kotlin leaving only thin groovy wrapper on top. The thing is Groovy with @CompileStatic enabled does not have any advantages over Kolin, yet the tooling and type system in Kotlin is much better. Also it is quite easy to call Kotlin code from Groovy. I am still using Groovy for outer layer because it has much better support for REPL and much more concise DSL syntax.

1 Like