Why inlining of a `suspend` function with no lambd...
# coroutines
j
Why inlining of a
suspend
function with no lambda among its params is not flagged as a warning (it is if the function is not
suspend
)?
c
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.
However, unless you have a proper benchmark showing that inlining is beneficial in your particular case, I wouldn't do it.
j
Oh yeah, the continuation counts as a lambda param, didn't think of it 🙂