Slow ORMLite performance on Android?

I am developing an Android application and trying to use ORMLite, but the performance seems very poor. Has anyone else experienced this?

Or am I doing something wrong?

EDIT

No. I do not make any connections, and all requests are made with indexed keys as parameters. But the data set is resonantly large, and there are quite a few comparisons.

Did not try to do with pure SQLite ...

+1
source share
1 answer

I think the best answer is that the performance of ORMLite is highly dependent on how you use it. If you can post some sample code, as well as some performance numbers, we can help more specifically.

If you perform multiple database operations at a time, you should use the Dao.callBatchTasks() method. In Android, it starts a database transaction, calls the one transferred to Callable and after it returns, it completes the transaction. This is significantly faster if, for example, you insert several rows into a table.

See also: Why is the DAO method so slow in ORMLite?

EDIT

If your queries are busy for a while, then most likely time is wasted on SQLite. You can try to reduce the portion of the data set or adjust the number of comparisons to make sure everything works faster, so you can finally determine that the culprit is SQLite (and most likely only IO).

+11
source

Source: https://habr.com/ru/post/1345147/


All Articles