Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Significant performance difference between SQLDelight and C++ on iOS #2246

Closed
schmidt9 opened this issue Apr 3, 2021 · 1 comment
Closed

Comments

@schmidt9
Copy link

schmidt9 commented Apr 3, 2021

First I faced this notable speed difference on iOS on simple select queries - C++ was about 4 times faster than KMM implementation using SQLDelight.

So I decided to prepare a test including bulk inserts and selects for both C++ and KMM with 100 000 records, results are: for inserts C++ is ~5 times faster than KMM, for selects C++ is ~7 times faster than KMM.

I prepared a test project with both implementations here

Is there something to do to improve SQLDelight performance? Maybe some tuning which I'm not aware of? Or is it generally a Kotlin issue?

@AlecKazakova
Copy link
Collaborator

i assume this is the nature of kotlin native and there is nothing we can do to speed it up. Even if it is a sqldelight thing the actual issue would be (sqliter)[https://github.com/touchlab/SQLiter] since that is the native sqlite implementation, and kevin could provide more insight over there. At least from SQLDelight's perspective we're just executing strings, theres probably room for improvement but the best would be comparisons on the jvm since then we're not introducing separate runtimes that could be causing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants