FastSeek WPF
A Windows-only WPF port of the FastSeek instant file search tool.
Requirements
- Windows 10/11
- .NET 8 SDK or later
- Administrator privileges (required for NTFS MFT and USN journal access)
Build
cd FastSeekWpf
dotnet publish -c Release -r win-x64 --self-contained false
Or just run from source:
cd FastSeekWpf
dotnet run
Must run as Administrator. Right-click β Run as Administrator, or launch from an elevated PowerShell.
Usage
- Alt+Space β toggle the search window
- Esc β hide
- Up/Down β navigate results
- Enter β open selected file/folder
- Ctrl+Enter β open containing folder
- Type β search as you type (results update instantly)
Architecture
The app reads the NTFS Master File Table (MFT) directly via FSCTL_ENUM_USN_DATA / direct $MFT read, builds an in-memory index, and keeps it in sync via the USN Change Journal. Search is name-only with fuzzy matching and type-based ranking.
Performance Fixes Applied
- Zero-CPU hotkey thread: Switched from
PeekMessageWpolling (Thread.Sleep(10)) to blockingGetMessageWwith a manual reset event for clean shutdown. Idle CPU is now 0%. - Allocation-free search:
SearchEngineuses cached lowercase string arrays (IndexStore.NameCache/NameLowerCache) instead of callingEncoding.UTF8.GetStringin the hot loop. UsesSpan<char>for matching, stack-allocated candidate arrays, and[ThreadStatic]reusableStringBuilderfor path building. - Debounced search: TextChanged no longer blocks the UI thread. Searches run on a background thread with 25ms debounce and a
CancellationTokenSourceto cancel stale queries. - DWM rounded corners: Added
DwmSetWindowAttributewithDWMWA_WINDOW_CORNER_PREFERENCE=DWMWCP_ROUNDfor native Windows 11 rounded window corners, plusDWMWA_USE_IMMERSIVE_DARK_MODE. - Arena-based inserts:
IndexStorekeepsList<byte>for arenas (O(1) append instead ofArray.Resizeon every insert). Live updates no longer copy the entire arena array. - Lock isolation: Search result building (path resolution, exclusion filtering, ranking) happens outside the
lock(_indexLock)β only the candidate matching is inside. Deadlocks eliminated.
Known Issues / TODO
- DWM rounded corners β fixed via
DwmSetWindowAttributeP/Invoke - Zero-CPU hotkey thread β fixed via
GetMessageW+ manual reset event - Arena allocation churn β fixed via
List<byte>.AddRange - Search blocking UI β fixed via debounced background search
- Search results could use a virtualized
ListViewwith container recycling for >10k visible items - No system tray icon β app runs hidden with hotkey toggle only
- No settings UI for exclusions