by tarasglek · 9y ago · 0 comments
They then do not offer logical analysis as to why things are faster.
My understanding is that reads are probably faster due to operating system readahead being able to predict reads better when they are within a single file. Writes are faster because they do one bulk COMMIT instead of many individual fsyncs.
One could, but then one would have great difficulty retrieving the individual files back when needed.
The point is not about what has the greatest raw speed, the point is that that for applications that read lots of small files from the filesystem, they'll possibly get better performance and almost certainly use less disk space by sticking the files in SQLite instead.
Not that great, and the point is its comparing apples to oranges, pointless.
You’d end up rewriting your own version of a database.
This is the hell we just crawled out of in one of our codebases.. it's not so much the access for a single process, but when you want to share the data in the file, that's when it seriously starts to get messy and breaking through otherwise clean abstraction layers and/or forcing recompile on compatibility breaking changes.
Oh goodness have we come a long way if interacting with a file is harder than interacting with a SQL database.
(it really depends on what language and/or library(ies) you use and for what purpose)
> The performance difference arises (we believe) because when working from an SQLite database, the open() and close() system calls are invoked only once, whereas open() and close() are invoked once for each blob when using blobs stored in individual files. It appears that the overhead of calling open() and close() is greater than the overhead of using the database. The size reduction arises from the fact that individual files are padded out to the next multiple of the filesystem block size, whereas the blobs are packed more tightly into an SQLite database.
https://eigenstate.org/paste/d41e3b69d258e3b52f7cee7a9921f02...
Conclusion seems to be that filesystems on windows are not well optimized for the usecase of reading and writing from many small files at once.
Which could explain poor windows performance in the benchmark (writing to 100,000 individual files).
What they did is check an untuned Ext4, UBIFS, HPFS+ and NTFS vs a tuned database in a single thread scenario. Especially misleading in the mmap case where synchronization would just kill the performance dead.