objectbox / objectbox-dart-performance

Flutter App benchmarking the performance of ObjectBox against others (e.g. sqflite, Hive).
https://objectbox.io/
11 stars 9 forks source link

Add drift to comparison #9

Open rodydavis opened 4 months ago

rodydavis commented 4 months ago

On mobile you would use SQLite in WAL mode to allow for much higher throughput of reads and writes.

Also drift is a very popular library that can work in an isolate and FFI for better performance.

greenrobot-team commented 4 months ago

Thanks for the tips! With regards to WAL, do you mean this dev tip? Or is there some sqflite API that I'm not seeing?

greenrobot-team commented 4 months ago

Change in #10, but looks like it makes things worse for this benchmark. Am I missing something here?

nikitadol commented 3 months ago

I think that comparing sqflite, which works via MethodChannel, with your native/FFI solutions is at least not correct

You can leave this as an example, but you should add the SQLite package that uses it via FFI - for example, drift was mentioned above

greenrobot commented 3 months ago

I think that comparing sqflite, which works via MethodChannel, with your native/FFI solutions is at least not correct

We make disclaimers about comparing async vs. sync and sqflite does not support synchronous last time we checked. Typical disclaimers include: we do not want to measure async overhead which has nothing to do with database tech. Also, we'll include async comparison in the future.

So, since improvements via WAL as initially suggested did not materialize (let us know if there's a way in a new ticket), I'll change this issue to focus on adding drift.

drewbitt commented 2 months ago

You can see here https://ente.io/blog/tech/sqlite-objectbox-isar/ and the relevant HackerNews post https://news.ycombinator.com/item?id=39289246 about SQLite improvements possible and WAL discussion, and in this use case, optimized SQLite usage being faster than ObjectBox generally.

greenrobot-team commented 2 months ago

@drewbitt Thanks for this! Then again this is a very specific use case (storing a list of floating point numbers or double). And as pointed out in the discussion the performance bottleneck seems to always be deserialization to a Dart object.

So again, I don't see how we can improve this benchmark which uses Dart objects with various properties given that information. I still welcome any suggestions!