Is there any performance stats for Kotlin/Native f...
# kotlin-native
j
Is there any performance stats for Kotlin/Native framework against Swift IOS with SQLite queries? Attached is my sample stat for a simple select query(select * from table) for around 40 rows of data. First column - Kotlin/Native - 0.0.285 s | Second column - IOS Swift - 0.0116 (Note: SQLDelight Queries in Kotlin/Native and SQLite Framework queries Swift IOS). Some stats or suggestion on how to take stats and any pin points to known performance drawback would be enlightening.
k
K/N is still in beta. JB has stated that there really hasn't been much focus on performance thus far.
j
I knew that kris. What I am looking for is some recent performance stats for purpose of comparison. No need to know why k/n is less performant.
a
I raised this issue recently, JFYI https://youtrack.jetbrains.com/issue/KT-39160
👍 1
k
Can you post the code? I wrote the underlying sqlite driver and the basic design of how sqldelight interfaces with it. There are ongoing performance discussions.
It would be a lot to summarize in general, but I’d like to see if your numbers hit on known issues that we plan to fix and/or if what you’re testing highlights something we could take a look at. I’m currently looking at the sqlite driver in a lot of detail, so good timing.
j
@kpgalligan Please check this out. Its a simple app and in viewDidLoad I've did the queries. I've also attached the framework. The KMP project is also inside in case if you wanna rebuild binaries.
@Arkadii Ivanov thanks for the link. I'll follow that up, too.
k
So, I’d say a few things. There’s a lot going on in the code that’s unrelated to sqldelight specifically. I’d also say my local sample size is a little over 300 rows, which is a very small sample size for benchmarking purposes. As for Swift vs K/N db operations, it’s not exactly a fair comparison to run direct sqlite calls in Swift vs a “managed” database library like sqldelight. I’d say you could measure direct sqlite on Kotlin, or (I guess) core data on iOS.
👍 1
j
Thanks @kpgalligan
k
I did run longer loops, and the Kotlin winds up being a little under 2x time, but I didn’t try direct sqlite. I don’t know how much faster that would be, but it would pretty much have to be faster.
👍 1