If you're using the same file, it would make sense if the db 'warms up' by growing enough to comfortably hold all your data.
An unscientific benchmark of SQLite vs. the file system (btrfs)
11–20 of 68 posts
Good point. That’s the more probable explanation, actually. I’d imagine the execution plan would be cached within the first batch of requests. I hadn’t considered the file resizing, but it’s a good hunch.
Re: An unscientific benchmark of SQLite vs. the file system (btrfs)
#12For SQLite in this test writes in particular means transactions, where each transaction contains exactly one write.
Re: An unscientific benchmark of SQLite vs. the file system (btrfs)
#13I’m the author. Out of curiosity, how did you find and post this before I did?
i follow you on github :)
sorry!
Re: An unscientific benchmark of SQLite vs. the file system (btrfs)
#14Re: An unscientific benchmark of SQLite vs. the file system (btrfs)
#15For SQLite in this test writes in particular means transactions, where each transaction contains exactly one write.
Yeah. It’s simulating the behavior of a CRUD server I’m thinking about writing. I wouldn’t be able to batch writes very easily there, so it would be a transaction per write.
Re: An unscientific benchmark of SQLite vs. the file system (btrfs)
#16TL;DR: yes, probably for a real-world use case.
Anyway, the perf is good enough for what I need, and the flexibility of querying makes it well worth it. There is something nice about plain text files, though.
Re: An unscientific benchmark of SQLite vs. the file system (btrfs)
#17The article doesn’t mention whether SQLite WAL mode is on. That could make SQLite significantly faster:
https://sqlite.org/wal.html
Re: An unscientific benchmark of SQLite vs. the file system (btrfs)
#18A quick google shows there are few FUSE SQLite implementations. Then you can use grep, ls, etc
Re: An unscientific benchmark of SQLite vs. the file system (btrfs)
#19The article doesn’t mention whether SQLite WAL mode is on. That could make SQLite significantly faster: https://sqlite.org/wal.html
It mentions it at the end:
./tmp.db?_timeout=5000&_journal=WAL&_sync=1
Not sure if it was updated after your comment.
Re: An unscientific benchmark of SQLite vs. the file system (btrfs)
#20Go is perhaps not the best tool to use for this as calling sqlite via Cgo will incur a penalty. Might be significant in a very hot loop.