FastFileSystem is a high-performance Java file search engine that combines indexing, searching, and real-time file monitoring through JNI bindings to native C++ code. Designed for Java applications requiring Everything-style file search capabilities, it provides zero-copy memory-mapped access and incremental updates via USN Journal on Windows.
Tags: file-search, filesystem, indexing, mmap, usn-journal, jni, cpp, windows, autocomplete, fuzzy-search
FastFileSystem is a unified C++ module that encapsulates FastFileIndex, FastFileSearch, and FastFileWatch into a single API, along with JNI bindings for FastJava integration.
Your three modules form a complete Everything-style file search engine:
- FastFileIndex - Full filesystem scan → produces a binary, mmap-capable index of all files.
- FastFileSearch - Builds Prefix Trie, N-Gram index, Exact Match map, and Ranking engine on top of the index.
- FastFileWatch - Uses USN Journal to keep the index + search structures live-updated with zero rescans.
This is exactly the architecture used by Everything, Spotlight, VSCode, and fsearch — but modular and embeddable.
- Unified C++ module encapsulating Index + Search + Watch
- Full mmap-based index access (no std::vector primary structure)
- JNI bindings with zero-copy (DirectByteBuffer + Offsets instead of String[])
- Java reads directly from mmap without copies
- Minimalistic, modular, high-performance
- Zero overhead, no copies, no GC stress
- Hot-reload capable (double mmap buffer + atomic pointer swap)
You now have:
- A full filesystem indexer
- A binary, mmap-capable index format
- A high-performance autocomplete engine
- A substring + fuzzy search engine
- A ranking engine
- A real-time file watcher with USN Journal
- A fully incremental search system with zero rescans
- JNI bindings for FastJava
- Unified C++ API
This is a complete, production-grade file search engine — modular, embeddable, and faster than most existing tools.
git clone https://github.com/andrestubbe/FastFileSystem.git
cd FastFileSystem
mkdir build && cd build
cmake ..
cmake --build .#include "FastFileSystem.hpp"
FastFileSystem fs;
fs.build({"C:\\"});
std::vector<FileEntry> results;
fs.search("query", 100, results);
fs.recordOpen(results[0].id);FastFileSystem fs = new FastFileSystem();
fs.loadIndex("files.idx");
SearchResult[] results = fs.search("fast", 64);
for (SearchResult result : results) {
System.out.println(result.path);
}
fs.close();- Windows 10+ (x86_64) - Fully supported with native implementation
- Linux - Planned
- macOS - Planned
This project is licensed under the MIT License - see the LICENSE file for details.
- FastFileIndex - Binary file indexing with mmap support
- FastFileSearch - Prefix Trie, N-Gram index, and Ranking engine
- FastFileWatch - USN Journal-based live file monitoring
- FastCore - Unified JNI loader and platform abstraction