requery / sqlite-android

Android SQLite support library
Apache License 2.0
1.06k stars 140 forks source link

Performance on "big" data compared to native Android #167

Open mtotschnig opened 1 year ago

mtotschnig commented 1 year ago

Planning to use sqlite-android with a Content-Provider App using SupportSQLiteOpenHelper.Factory, I have been comparing its performance on a fairly big table (35624 entries) and complex query: In two contexts, I have observed native Sqlite being considerably faster. On an Android 10 Xiaomi Mi A2, my app's main query takes 6 seconds with sqlite-android and 400 ms with native Sqlite On an Android 11 Emulator, 550 ms with sqlite-android and 150 ms with native Sqlite

Is there some configuration I am missing, that is needed to make sqlite-android run with performance on par with native?

mtotschnig commented 1 year ago

The problem seems specific to version 3.39.2 (and 3.39.0-1). If I use the previous version available from Jitpack (3.36.0), performance of sqlite-android and native sqlite are on par.

mtotschnig commented 1 year ago

In order to understand if the observed difference is due to the way sqlite-android is build or to a change in sqlite3 itself, I compiled versions 3.36.0 and 3.39.2 of sqlite3 on my Linux workstation, and compared performance of the same query on the same data. They perform the same.

npurushe commented 1 year ago

Thanks for reporting might be related to the jitpack build updates