ORM performance: is greenDAO faster than ORMLite?

风格不统一 提交于 2019-12-02 14:18:23

We've just published a Github project that we used to compare the performance of ORMLite and GreenDao to raw SQLite:
https://github.com/daj/android-orm-benchmark

The project also allows you to compare the performance of an in-memory database to an on disk one.

The headline results are:

GreenDao is much faster than ORMLite. It is roughly:

  • 3X faster at writing large numbers of objects.
  • 50% faster at reading in all 10000 entries in a single table.
  • 2X to 3X faster at an indexed read of a single row (though both were very fast).
  • 15X faster at doing a LIKE search for 100 records in a 10000 entry table.

The project contains both a naive raw SQLite benchmark, and an optimized SQLite benchmark.

GreenDao vs unoptimized raw SQLite

  • GreenDao is 2X faster for the write benchmark.
  • GreenDao is 25% slower for the read benchmark.

GreenDao vs optimized raw SQLite

  • GreenDao is 50% slower for the read and write benchmarks.

For detailed results please see the Github repository above.

Of course we may have bugs in our benchmarking code...if you find any please fork, fix and submit a pull request! :-)

Disclaimer: make sure you do your own research before choosing GreenDao over ORMLite.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!