Hraness
Theme
Appearance

saved

FSearch

by Noah DunnaganGitHubpublished

Hraness wrote this summary from a saved copy of the source. Quotations are taken word for word from the source.

gist

Noah Dunnagan’s FSearch is an MIT-licensed Rust whole-disk file search for macOS, usable as a CLI with a small daemon or as a crate. It finds files by fuzzy, typo-tolerant name in about 1.3 ms across 7.7 million files and greps contents through a trigram index, and its README benchmarks it as roughly ten times faster than fff on Chromium.

ideas

  • Speed numbers. On an M4 Max with 7.7M files: name search p50 1.3 ms, content search p50 9 ms, changes visible in about 0.1 s, a one-time 20 s crawl, and 30 to 135 MB of daemon memory.
  • Versus fff. On Chromium’s 509k files it reports 1.1 ms versus 13.8 ms for names, 5.6 ms versus 53 ms for contents, and 50 MB versus 358 MB of memory, though fff searches about 9% more files.
  • Query language. Fuzzy words with one-typo tolerance for 5+ letter words, plus exact, prefix, suffix, and exclude operators and filters like ext, type, size, mtime, regex, grep, and sym.
  • Integration. A JSON-lines socket API or stdio mode, a linkable Rust crate, and one shared index across apps and the CLI.
  • How it works. A single getattrlistbulk crawl kept current by FSEvents, names in one mmap’d file laid out folder by folder, and a trigram index over text files.

quotes

“Finds any file by name in about a millisecond, forgives typos, and searches inside files with an index.”

Noah Dunnagan, the README’s pitch.

“Without access it skips the protected folders instead of popping a prompt.”

Noah Dunnagan, on macOS Full Disk Access.

“An app and the CLI share one index: the first process owns it and the others follow along.”

Noah Dunnagan, on sharing the index across processes.

“Matches are read fresh from disk, so they're never stale.”

Noah Dunnagan, on trigram content search.