3 ms·
Kotlin has a runtime cost here, by inserting runtime null checks. You can disable them with a compiler flag if you don't have non-Kotlin consumers.
by tadfisher 4y ago
Kotlin has a runtime cost here, by inserting runtime null checks. You can disable them with a compiler flag if you don't have non-Kotlin consumers.
- ackfoobar 4y agoSomeone did the JMH test for the cost of explicit null checks. https://sites.google.com/a/athaydes.com/renato-athaydes/posts/kotlinshiddencosts-benchmarks https://sites.google.com/a/athaydes.com/renato-athaydes/post... Apparently the JVM can inline, then do null check elimination.