The Cost of Kotlin Language Features
summary
Benchmarks and bytecode inspection show Kotlin rarely forces catastrophic slowdowns: simple let usage compiles to nearly the same JVM bytecode, but JMH benchmarks reveal a consistent ~3–4% cost per non-null public parameter from runtime null checks; string templates cost ~5–8% in short concatenations due to extra empty-string appends; passing function values causes boxing that can halve throughput for primitives; experiments run on a Raspberry Pi to avoid noisy hosts and highlight the non-null check overhead.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 2:55Why Care
- 4:45Lets
- 11:20MicroBenchmarks
- 15:40Why is Java quicker
- 17:43String interpolation
- 20:34Running benchmarks
- 23:57Kotlin properties
- 26:32Kotlin functions
- 29:41Kotlin mapping
- 32:59Other costs
- 34:59Conclusion








