in terms of performance. Are both of these constructs inlined or only the latter?
e
ephemient
01/03/2024, 4:06 AM
it's easy to check for yourself
ephemient
01/03/2024, 4:30 AM
well I guess one thing that is harder to check for yourself (unless you have older versions of the compiler around) is that this has changed over time…
ephemient
01/03/2024, 4:30 AM
the old JVM backend doesn't inline the former (and the current compiler doesn't let you use
-Xuse-old-backend
anymore, so that's a bit tricky to test)
ephemient
01/03/2024, 4:31 AM
the JVM IR backend does inline it, although that's not a documented behavior you can rely on AFAIK
a
Alexander Ioffe
01/03/2024, 4:57 AM
Thanks!
y
Youssef Shoaib [MOD]
01/03/2024, 5:00 AM
The run version is definitely more idiomatic though. The JS IIFE has no place in Kotlin.