1

I'm developing an application for Android, and have tried to use ORMLite, but the performance seems to be really poor. Has anyone else experienced this?

Or am I doing something wrong?

EDIT

No I'm not doing any joins, and all queries are made with indexed keys as parameters. But the data set is resonably big, and there is quite many comparisions.

Haven't tried to do with pure SQLite...

Gray
  • 115,027
  • 24
  • 293
  • 354
johan
  • 6,578
  • 6
  • 46
  • 68
  • 2
    Might help to post the code / data that performs poorly. Some questions to ask: Is there a join? Is the join field indexed? Do you have tons of columns being mapped? A really big data set? Do you get the same performance issues writing your query as SQLite yourself? What SQL is actually being generated by SQLite for your poorly-performing queries? – Yoni Samlan Aug 26 '11 at 15:46

1 Answers1

11

I guess the best answer is that the performance of ORMLite is highly dependent on how you use it. If you could post some of the code samples as well as some of the performance numbers, we may be able to help more specifically.

If you are making a number of database operations at one time, you should consider using the Dao.callBatchTasks() method. Under Android, it starts a database transaction, calls the passed in Callable and after it returns, it commits the transaction. This is significantly faster if you are, for example, inserting a number of rows into the table.

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

EDIT

If your queries are taking a while then most likely the time is being spent in SQLite. You could try reducing some of the dataset or tuning the number of comparisons to see if things run faster so you can definitively determine that SQLite (and more likely just IO) is the culprit.

Community
  • 1
  • 1
Gray
  • 115,027
  • 24
  • 293
  • 354
  • 2
    To add to this, consider typical DB tweeks with large amounts of data. These can include partitioning data into different tables or databases which are categorised to assist choosing which partition to check before the qurey. – Steven Nov 09 '11 at 06:47