ORM performance: is greenDAO faster than ORMLite?

后端 未结 1 696
耶瑟儿~
耶瑟儿~ 2021-01-30 04:27

I\'ve been using ORMLite in my application and I was considering whether to move to greenDAO.

Performance is a huge part of that decision, and greenDAO\'s Features page

相关标签:
1条回答
  • 2021-01-30 05:02

    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.

    0 讨论(0)
提交回复
热议问题