"Complex Load" does not make much sense #16

Open
greenrobot opened this Issue Jul 12, 2016 · 0 comments

Projects

None yet

1 participant

@greenrobot
Contributor
greenrobot commented Jul 12, 2016 edited

The tests for "load" in the "complex trial", loads 50 address books and then walks along the relations potentially resolving them on the fly (doing database requests). I had a closer look why DbFlow takes just a few milliseconds (usually single digit) while all others take hundred of milliseconds. I think the test set up is questionable: after inserting the entities, they stay around in memory initialized with all relations already set up for DbFlow. So what happens is that DbFlow makes a single query and is done, while others must hit the database multiple times. So you test rather caching than loading. I could send a trivial PR for greenDAO in order to make the same caching work, which would also result in single digit ms test runs.

However, I'd rather propose to clear all caches before doing the complex load test to actually benchmark loading. For greenDAO, you can clear the memory "cache" using daoSession.clear(). I don't did not find the equivalent in DbFlow, so I could not try myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment