Thank you very much for your analysis. It was very helpful.
A 9 times performance improvement puts it within a order of magnitude of the JVM performance, which should be considered acceptable. Especially given the fact that my application seems to trigger everything that makes Kotlin native slow. It’s doing deep recursions on very large arrays of boxed numbers.
I have a plan to add an optimisation where arrays of integers or floating point numbers gets specialised implementations using arrays on unboxed numbers. Based on what you have told me, it would seem as though the native version would benefit a lot more from this than the JVM?