function with no lambda among its params is not flagged as a warning (it is if the function is not
suspend
)?
c
CLOVIS
07/04/2023, 9:06 AM
Runtimes (e.g. the JVM) are able to inline regular functions by themselves when it is beneficial to do so, so inlining regular functions at compile-time is not necessary, and may make the code slower.
suspend
functions are more complicated, runtimes can't inline them automatically.
CLOVIS
07/04/2023, 9:06 AM
However, unless you have a proper benchmark showing that inlining is beneficial in your particular case, I wouldn't do it.
j
julioromano
07/04/2023, 11:14 AM
Oh yeah, the continuation counts as a lambda param, didn't think of it 🙂