https://kotlinlang.org logo
Title
k

keishi kubo

02/24/2020, 2:26 PM
I might understand. Thank you! 🙂 Is such overhead so large that I should often care about ?
e

Evan R.

02/24/2020, 3:54 PM
Generally you don’t need to worry about it. I usually only do it when I’m using a function to wrap a single function call or expression. I may also do it if I know I need to return/continue from a passed lambda
👍 1
l

Leon K

02/24/2020, 5:05 PM
I generally do
inline
where it's possible. While there is a not that relevant performance impact, the main reason is that an inline function is independent from
suspend
contexts, thus, when calling your function from a
suspend
fun, you can use other suspend fun's within the lambda if it is inline
👍 1
e

Evan R.

02/24/2020, 6:19 PM
Just be sure not to overuse it, as it can increase your binary size if used frequently enough and (I think) make stack traces inaccurate
👍 1