Giter Club home page Giter Club logo

for-test's Introduction

一. LiteOrm 和 greenDAO 的性能对比

下面是一组直观的测试数据,分为循环操作和批量操作两种场景:

greenDAO vs LiteOrm 循环测试

greenDAO vs LiteOrm 批量测试

测试相关过程:

  1. 运行 Test Demo,点击 LiteOrm 测试按钮,通过日志观察执行完毕。

  2. 命令行卸载 Test Demo,重新运行,点击 GreenDAO 测试按钮,通过日志观察执行完毕。

  3. 每次点击按钮,所有操作会连续测试 10 次,取 10 次消耗时间的均值,安静等待结果就好了。

测试相关信息:

  1. 测试机为 Nexus5,取 10 次消耗时间的均值。

  2. 为了更直观清晰的观察数据,将循环操作和批量操作分开统计,否则因为两者数据差异过大,柱状图无法看清小数据的数值。

  3. 循环单个操作比较耗时,每次操作 1000 条数据。

  4. 批量操作因为整体是事务的,效率非常高,每次操作 100000 条数据。

测试相关结论:

  1. [循环插入]、[循环更新] 以及 [批量更新] 时,LiteOrm性能略强于greenDAO。

  2. [批量插入]、[查询操作] 时,LiteOrm性能略逊于greenDAO。

  3. 除了 [批量查询] 以外,其他性能优劣势差距不明显,[批量查询]耗时差异主要来源于 LiteOrm 采用反射创建实例并赋值属性,而 greenDAO 使用 new 操作直接创建对象并直接赋值属性。

for-test's People

Contributors

litesuits avatar

Watchers

James Cloos avatar TUBB avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.