This repo, reproduces the KorGE bunnymark-fast update code that is slow on Kotlin/Native, it is self-contained, except when marking all the methods as inline (that hurts performance on JVM and JS).
Details here: https://kotlinlang.slack.com/archives/C3SGXARS6/p1619349974244300 Related YouTrack issue: https://youtrack.jetbrains.com/issue/KT-46425
There are three self-contained implementations without external dependencies adjusting inlining const val
and marking all the methods as inline
:
Executing INLINED...
Executed INLINED sixty frames in 703ms
Executing NON-INLINED-BUT-CONST...
Executed NON-INLINED-BUT-CONST sixty frames in 1.03s
Executing NON-INLINED...
Executed NON-INLINED sixty frames in 26.5s
Executing INLINED...
Executed INLINED sixty frames in 1.04s
Executing NON-INLINED-BUT-CONST...
Executed NON-INLINED-BUT-CONST sixty frames in 1.71s
Executing NON-INLINED...
Executed NON-INLINED sixty frames in 4.84s
Executing INLINED...
Executed INLINED sixty frames in 865ms
Executing NON-INLINED-BUT-CONST...
Executed NON-INLINED-BUT-CONST sixty frames in 38.7s
Executing NON-INLINED...
Executed NON-INLINED sixty frames in 63.3s
Kotlin 1.4.32 (Windows) (Patched) JetBrains/kotlin#4339
Executing INLINED...
Executed INLINED sixty frames in 864ms
Executing NON-INLINED-BUT-CONST...
Executed NON-INLINED-BUT-CONST sixty frames in 10.3s
Executing NON-INLINED...
Executed NON-INLINED sixty frames in 14.4s
Executing INLINED...
Executed INLINED sixty frames in 1.26s
Executing NON-INLINED-BUT-CONST...
Executed NON-INLINED-BUT-CONST sixty frames in 6.02s
Executing NON-INLINED...
Executed NON-INLINED sixty frames in 9.17s