


When working on some high-performance algorithms. Note that optimizing these calls away using ProGuard is not necessarily a good solution, as using ProGuard optimization isn’t strongly recommended on Android.

This seems wasteful, and I wonder how this performs on Android (where I don’t know whether inlining will take place).Īs stated here, it’s possible to avoid generating these calls with -Xno-param-assertions and -Xno-call-assertions, but these options are unsupported and could be removed.Ĭould these flags be supported? Or could Intrinsics.checkParameterIsNotNull perhaps be marked inline? I feel like this is an important topic that isn’t being taken seriously on Android. If we call foo 100 times in a loop, Intrinsics.checkParameterIsNotNull will be called 300 times. For example, every time the following function is called, there will be three calls to Intrinsics.checkParameterIsNotNull: fun foo(first: String, second: String, third: String) Non-nullable parameters (of functions visible to Java code) are null-checked at run time via calls to Intrinsics.checkParameterIsNotNull.
