mbdavid / LiteDB

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

[QUESTION] Performance analysis vs SQLite #1663

Open CristianT opened 4 years ago

CristianT commented 4 years ago

Hi,

I'm trying to decide which local, file based data base to use in my application and I wanted to have some performance metrics?

Is there any article regarding that?

My application is primarily going to insert data and I will retrieve the data later and whitout time constrains, this is why I wrote a very simple metric comparison using prometheus and grafana and the results are a bit suspicious.

Here is my analysis, feel free to point out issues in the code: https://github.com/CristianT/LiteDBvsSQLite

If my analysis is correct LiteDB smashes SQLite+EF in writing performance.

HankG commented 4 years ago

Is the SaveChanges in the for loop the same as the behavior in LiteDB or is it on close that the final LiteDB writes are happening?

CristianT commented 4 years ago

It is a good question but I also monitor the file size and it grows linearly, and the program memory doesn't increase, so my assumption is that the data is written in the SaveChanges

HankG commented 4 years ago

I will admit that I've found SQLite very slow on individual commits so have to throw it into batch mode for stuff like that.