mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.62k stars 1.25k forks source link

[QUESTION] LiteDb performance issue between Xamarin and MAUI/net7 #2276

Open LukasKuchta opened 1 year ago

LukasKuchta commented 1 year ago

Hello, we are porting Xamarin app into Maui/.net7 and we have issue with performance. Code is same "only" platfrom is different.

Db has 30K records. xamarin - read all => 20s maui - read all -> 80s windows - xUnit test -> super fast

I tested it on Android. iOS will be later.

What can be problem with it ? Or any advice for debuging this behaviour ?

LukasKuchta commented 1 year ago

We made small sample apps. Empty no unnecessary code here.

And result is: MAUI (net7.0-ios): Upserted 25000 items in 50.0988223 Selected 25000 items as TeamItemDto in 30.6884797 Selected 25000 items as Bson in 14.0719025

Xamarin.iOS: Upserted 25000 items in 32.9143934 Selected 25000 items as TeamItemDto in 6.9651505 Selected 25000 items as Bson in 4.4160259

Can you someone explain me what is wrong? Any optimization settings? It is issue for liteDB or MAUI ?

LukasKuchta commented 1 year ago

there is the source code: https://github.com/LukasKuchta/XamarinMauiDbTest simple maui and xamarin app.

and there are some numbers https://github.com/LukasKuchta/XamarinMauiDbTest/wiki

We added the SQLite for comparsion and issue in performance is visible too. Seems no db engine problem.

MAUI performnance is very bad against the xamarin. Thanks for check.

shmoe01 commented 1 year ago

I am glad to see someone else having the same issues we are. We recently ran into this and don't have the data to back it up. But we are observing similar issues in our application