Ran
06/01/2022, 6:14 AMandylamax
06/01/2022, 8:11 AMRan
06/01/2022, 8:20 AMHow did you run your benchmarks??Build my KMP library for js and iOS. Write two calculation functions, one uses the native object(bignumber.js in JS, NSDecimalNumber in iOS), and another one uses my library. Then run them on their respective platforms.
Also, how are you comparing js and ios?Not compare JS and iOS. The first picture shows the result on JS, using bignumber.js directly vs using my KMP library. The second picture shows the result on iOS, using NSDecimal directly vs using my KMP library.
Karel Petránek
06/01/2022, 11:15 AMArkadii Ivanov
06/01/2022, 11:30 AMArkadii Ivanov
06/01/2022, 11:32 AMRan
06/01/2022, 11:33 AMRan
06/01/2022, 11:33 AMArkadii Ivanov
06/01/2022, 11:36 AMRan
06/01/2022, 11:36 AMArkadii Ivanov
06/01/2022, 11:43 AMis
and as
operators may be slow. There is unsafeCast
for this.Ran
06/01/2022, 1:01 PMRan
06/01/2022, 1:01 PMYou can try Kotlin 1.7.0 beta. And perhaps file tickets with your benchmarks on YouTrack.You mean I create a new ticket?
Ran
06/01/2022, 1:02 PMIn my experience the bridging between Kotlin and native ObjC objects is quite expensive, it’s usually better to avoid crossing the Kotlin-ObjC boundary when performance is key.Is there any best practice for that?
Arkadii Ivanov
06/01/2022, 1:02 PMRan
06/01/2022, 1:03 PMRan
06/02/2022, 10:58 AMMimalloc allocator isn't supported on target ios_simulator_arm64. Used standard mode
Arkadii Ivanov
06/02/2022, 1:46 PMios_simulator_arm64
mapping is missing - https://github.com/JetBrains/kotlin/blob/f9226841698132df5fe2644873f7984f308885ef/[…]lin/org/jetbrains/kotlin/konan/target/KonanTargetExtenstions.kt
You can try another target (e.g. X64) and check if it makes any difference. And perhaps file a ticket in the repository?Ran
06/02/2022, 2:30 PMArkadii Ivanov
06/02/2022, 2:33 PM