Kotlin Syntactic Sugar in Bytecode: Which Ones Are Actually Free

Kotlin Syntactic Sugar in Bytecode: Which Ones Are Actually Free

I compiled a dozen Kotlin sugars and read the javap output. Three tiers: ?. is a real ifnull jump with zero allocation, inline saves 0.01 B per call while copying the body, string templates hinge on jvmTarget, and lazy’s three modes I could not measure.

2026-11-13 · 7 min · 1461 words · Trevor Wang