Zed's team improved project search performance by addressing task scheduling priorities rather than low-level optimizations. The original implementation treated all search tasks equally, causing tasks that confirm matches to be starved by the overwhelming number of candidate-checking tasks. By restructuring the code to explicitly prioritize confirming matches in files already known to contain results using select_biased!, they reduced first-match latency from 3.8 seconds to 1.1 seconds on Linux kernel searches and from 16.8 seconds to 32 milliseconds on Rust repository searches. The solution demonstrates how understanding concurrency patterns and work distribution can yield significant performance gains without resorting to SIMD or assembly-level optimizations.
Table of contents
How does one search in a project?Project search is not always fastRipgrep? Not on our watch!Enough dilly-dallying: let's get to workWork smart, not hardCase closed?1 Comment
Sort: