Hello Kotlin Friends,
I do have issues with the performance of Kotliin/Native IntArray access.
Here is the code:
fun createGetSet() {
val time = measureTime {
for (i in 0..loopNumber) {
val array = IntArray(arraySize) { index -> index }
for (index in 0 until arraySize) {
val value = array[index]
array[index] = value * 2
}
}
}
println("[Int Array] CreateGetSet: ${time.inWholeMilliseconds} ms")
}
With a loop number of 1000 and an arraySize of 500x500, the measured time is:
on JVM - [Int Array] CreateGetSet: 154 ms
on iOSX64 - [Int Array] CreateGetSet: 3385 ms
This seems to be related to bridging Kotlin Int with native primitive int.
Any ideas how to solve iOS PERFORMANCE ???
Thanks