Make search much faster - #62658
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @39ali on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
We require contributors to sign our Contributor License Agreement, and we don't have @39ali on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
We require contributors to sign our Contributor License Agreement, and we don't have @39ali on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Objective
Project search sends one candidate per file to its worker pool, and each one
carried an owned
Snapshot. Every field ofSnapshotis cheap to clone exceptalways_included_entries, aVec<Arc<RelPath>>holding one entry peralways-included file.
With a broad file_scan_inclusions such as **/*, that vector holds an entry per file in the project, so cloning it once per file made search O(files²).
Partially addresses #38799 (still needs to fix the huge memory usage and the occasional stutters) .
Solution
Share the snapshot behind an
Arcinstead, the consumer only readsid(),abs_path()and
root_name(), so nothing needs an owned copy.Testing
Using the linux kernel repo, i searched for
vmx_l1d_should_flushandnetif_rxand its at least 60x faster on 5950x.with
file_scan_inclusions: ["**/*"]Release Notes:
file_scan_inclusions