Live data from Hacker News

SQLite is 35% Faster Than The Filesystem (2017)

sqlite.org

121–130 of 137 posts

Re: SQLite is 35% Faster Than The Filesystem (2017)

#121

Is it a known issue that the filesystem on Windows 10 is so slow? Being 5 times slower than macOS was roughly my experience but I thought there was just something wrong with my Windows laptop. I can't find any benchmark or explanation about this.

Personally, I have not seen that. Which operations did you think were slow? Small-block/large-block?, sequential/random I/O ? etc, etc. Or did you just mean general productivity?

I know that the open function on files is very slow. This makes opening many small files very slow.

Re: SQLite is 35% Faster Than The Filesystem (2017)

#122
post #38

Earlier quoted context omitted.

This has very little to do with Windows, itself. The issue is explorer that tries to estimate sizes and put the files in the recycled bin. Also likely it checks all the permissions while counting. Try the command line: "rmdir /s" and it's quick.

What about refusing to delete files that some process has open in a dangling descriptor? Is that just a GUI thing? I'm pretty sure it isn't. Also, is there a better way to hunt down the background process than sysinternals? It seems pretty ridiculous that a low level debugging tool is required to do something as modest as reliably move and delete files, but I never heard of a better workaround.

>What about refusing to delete files that some process has open in a dangling descriptor?

This is how it is on Windows. Linux handles open file deletion a lot better.

Re: SQLite is 35% Faster Than The Filesystem (2017)

#124
post #90

Earlier quoted context omitted.

Yeah, IMO there’s certain tech that HN, in aggregate, likes a lot, and readily upvotes positive articles about - SQLite is in that category, along with Postgres, CockroachDB, Go, Rust, etc. There’s also certain tech HN, in aggregate, strongly dislikes, and readily upvotes negative articles - Mongo, anything “modern JS ecosystem”, systemd, etc.

Often for good reason too. SQLite is amazing. Modern JS and frameworks...not so much.

I think tech like a lot of modern JS frameworks, and Mongo, are really good at dev productivity, especially in the earlier days of products. If you're at a very new startup where the company could die any day, and you must ship absolutely as fast as possible to keep the company alive, that can be a truly essential feature.

But then if said startup gains traction and the team/codebase/systems grow a lot, it can easily become hard to maintain, and you probably wish your backend was implemented in, say, Go/Postgres over Node/Mongo. Or that your mobile apps were written in Swift and Kotlin over React Native. And I think a lot of the HN crowd works at "startups becoming big businesses", so this is probably a common headache. But it doesn't necessarily mean the tech is BAD, just that it's good for certain things (like early days productivity), but a pain for others (maintainability as the system scales).

SQLite is a bit unique in that it's just a super high quality piece of software, that is arguably the best short AND long term solution for the problem it solves (mostly being an embedded DB). But for software where it's more of a tradeoff around early productivity vs. long term maintainability, I think HN is pretty strongly on the long term maintainability side, and that's more of an opinion/choice than a clearly "correct" answer.

Re: SQLite is 35% Faster Than The Filesystem (2017)

#125

Earlier quoted context omitted.

My theory is that the OS likes to do a deep inspection of your files in order to feed microsoft's machine learning models.

your theory is based on ignorance and suspicion instead of anything real.

And what is your's based on? It's proprietary software. We're not supposed to know how it works or what it's doing.

Re: SQLite is 35% Faster Than The Filesystem (2017)

#126
post #78
post #14

Earlier quoted context omitted.

See here for some notes from the WSL team why certain filesystem operations that would be fast on Linux are slow on Windows: https://github.com/microsoft/WSL/issues/873#issuecomment-391... https://github.com/microsoft/WSL/issues/873#issuecomment-425...

I'm going to have to complain about this because in real world use these are far less of a problem than MFT contention on sub-900 byte files generated by typical unix environments. Particularly things that are lockfile heavy and VCSs etc are the most painful. The WSL thing reads like an excuse here. If you actually go and look at what's happening it's small files which are the damage multiplier. I think the real issu…

I'm sorry, but I find that hard to believe when the linked posts are from a Microsoft employee, who says repeatedly that the problem isn't a simple as "NTFS is slow," that they spent a release optimising NTFS, they've gotten rid of all the low hanging fruit and so on. I don't see why they'd be making excuses for NTFS when the underlying problems seem to be much more fundamental to Windows, which is much worse. You say you discovered the MFT contention issue when you were working on Subversion a decade ago, but these posts are from 2018, so I'm inclined to believe that the MFT contention issue has been mitigated and the real issues really are things like filter drivers, like they say.

I'm also not sure there's two paradigms here, if by that you mean there are workloads more suited to Linux and workloads more suited to Windows. Are there any file system operations that are actually faster on Windows? I'm still inclined to believe, like they say, that "file operations in Windows are more expensive than in Linux," even if large files are less impacted than small files.

I really hope Microsoft can improve this, rather than just throwing it under the rug and saying to use Linux VMs, even if they have to make drastic changes like deprecating filesystem filter drivers completely. I think a lot of us depend on the performance of software that was designed for fast filesystems and ported to Windows (not just Git, either.) I also think a lot of tasks fundamentally use a lot of small files. After all, what is source code?

Re: SQLite is 35% Faster Than The Filesystem (2017)

#127
As much as I love sqlite, if I understand correctly, this is telling that sqlite doing fread on an already opened file is 35% faster than not-sqlite doing fopen+fread on a single file.

Is this just a blatantly dishonest comparison, or did I miss something?

Re: SQLite is 35% Faster Than The Filesystem (2017)

#128

Earlier quoted context omitted.

Yeah, 'cause the incredible fragmentation of Linux GUI toolkits and windowing systems is so fun to deal with. Year of Linux on the Desktop when.

> Year of Linux on the Desktop when. Couple decades ago for me. > Yeah, 'cause the incredible fragmentation of Linux GUI toolkits and windowing systems is so fun to deal with. Sounds like probably "never" for you. You seem hostile toward Linux, so you're probably better off sticking with whatever you use currently.

I don’t think calling GP “hostile to Linux” after they critiqued one part of the ecosystem is very fair. All systems have their flaws, and if judging part of a system negatively makes you hostile to that system, then I guess Linus Torvalds is hostile to Linux too.

Re: SQLite is 35% Faster Than The Filesystem (2017)

#129
post #87
post #38

Earlier quoted context omitted.

This has very little to do with Windows, itself. The issue is explorer that tries to estimate sizes and put the files in the recycled bin. Also likely it checks all the permissions while counting. Try the command line: "rmdir /s" and it's quick.

This is true, but I don't understand why Explorer has been plagued with performance issues (and some of those intermittent; I presume based on network status) since forever. I'm actually a big fan of Windows on the desktop, and as long as I avoid Explorer, I have no issues at all with file system performance while I'm developing, working from the command line, VS Code and Rider, and working with containers and WSL -…

So true, I really have to say Explorer sucks. Recently I've been bothered by an issue that it tries to fully read every ts file, like maybe it's trying to read a Typescript file, but in my recent cases they are usually streamed video files of several GBs... It just never gives up and use my disk usage at 100%, I just have to kill explorer.exe everytime. I even tried messing with Registry about ts file but that's no good.

And even its Item Handler system is flawed. Still about .ts, it could stutter when I open context menu on ts files, then freeze forever if I hover over just 1 bit on "Open with" menu.

Re: SQLite is 35% Faster Than The Filesystem (2017)

#130
There's a great Software Engineering question here, and that is,

Should SQLite be modified such that its code, when compiled with a specific #define compilation flag set, be able to act as a drop-in filesystem replacement source code -- for an OS?

?

I wonder how hard it would be to retool SQLite/Linux -- to be able to accomplish that -- and what would be learned (like, what kind of API would exist between Linux/other OS and SQLite) -- if that were attempted?

Yes, there would be some interesting problems to solve, such as how would SQLite write to its database file -- if there is no filesystem/filesystem API underneath it?

Also -- one other feature I'd like -- and that is the ability to do strong logging of up to everything that the filesystem does (if the appropriate compilation switches and/or runtime flags are set) -- but somewhere else on the filesystem!

So maybe two instances of SQLite running at the same time, one acting as the filesystem and the other acting as the second, logging filesystem -- for that first filesystem...

Post reply on HN