ZIm/crates
Thorsten Ball 0a78c67647 Improve performance of select-all-matches
This fixes #6440.

The previous approach was calling select-next-match in a loop, which
leaves optimizations on the table when you already know that you want to
select all of the matches.

So what we did here is to optimize the code for the "give me all
matches" case:

1. Find all results in the current buffer
2. Build up *all* selections
3. Sort selections & throw away overlapping ones (keep oldest)
4. Unfold if necessary
5. Render selections

On my M3 Max searching for `<span` in the test file [1] from the ticket,
it

previously took: ~1.07s
now takes: ~4ms

[1]: https://github.com/standardebooks/edgar-allan-poe_poetry/blob/master/src/epub/text/poetry.xhtml

Co-authored-by: Antonio <antonio@zed.dev>
2024-01-25 13:35:22 +01:00
..
activity_indicator chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
ai Move interaction with keychain off the main thread 2024-01-24 14:53:05 +01:00
assets chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
assistant Allow prompts to have detail, and use for good 2024-01-24 23:15:37 -07:00
audio chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
auto_update Allow prompts to have detail, and use for good 2024-01-24 23:15:37 -07:00
breadcrumbs chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
call chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
channel Allow completions of everyone in the call 2024-01-24 10:51:46 -07:00
cli chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
client Try to send typed errors back and forth 2024-01-24 20:32:39 -07:00
clock chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
collab Try to send typed errors back and forth 2024-01-24 20:32:39 -07:00
collab_ui Allow prompts to have detail, and use for good 2024-01-24 23:15:37 -07:00
collections Remove license-file from Cargo.toml as it is apparently redundant (#4218) 2024-01-23 17:40:30 +01:00
color chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
command_palette chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
copilot chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
copilot_ui chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
db Replace tempdir crate with tempfile 2024-01-24 17:58:09 +00:00
diagnostics Fix rendering of diagnostic blocks (#4232) 2024-01-23 16:39:57 -07:00
editor Improve performance of select-all-matches 2024-01-25 13:35:22 +01:00
feature_flags chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
feedback collab errors (#4152) 2024-01-24 23:23:58 -07:00
file_finder Clear selected index when updating file finder's matches 2024-01-23 15:39:52 -08:00
fs chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
fsevent Replace tempdir crate with tempfile 2024-01-24 17:58:09 +00:00
fuzzy chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
git chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
go_to_line chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
gpui Update cocoa to crates.io version (#6452) 2024-01-25 10:04:29 +02:00
gpui_macros Remove license-file from Cargo.toml as it is apparently redundant (#4218) 2024-01-23 17:40:30 +01:00
install_cli chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
journal chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
language Simplify language server startup (#6449) 2024-01-24 17:36:50 -08:00
language_selector chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
language_tools chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
live_kit_client Update cocoa to crates.io version (#6452) 2024-01-25 10:04:29 +02:00
live_kit_server Remove license-file from Cargo.toml as it is apparently redundant (#4218) 2024-01-23 17:40:30 +01:00
lsp chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
media Remove license-file from Cargo.toml as it is apparently redundant (#4218) 2024-01-23 17:40:30 +01:00
menu chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
multi_buffer chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
node_runtime chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
notifications chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
outline chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
picker Render file finder separator in a way that doesn't affect layout 2024-01-23 15:39:52 -08:00
plugin chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
plugin_macros chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
plugin_runtime chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
prettier chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
project Log error if worktree fails to relativize git repo path 2024-01-25 11:10:00 +01:00
project_panel Allow prompts to have detail, and use for good 2024-01-24 23:15:37 -07:00
project_symbols chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
quick_action_bar chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
recent_projects chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
refineable Remove license-file from Cargo.toml as it is apparently redundant (#4218) 2024-01-23 17:40:30 +01:00
rich_text chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
rope chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
rpc Allow prompts to have detail, and use for good 2024-01-24 23:15:37 -07:00
search Allow prompts to have detail, and use for good 2024-01-24 23:15:37 -07:00
semantic_index Add missing .unwrap() 2024-01-24 18:19:03 +00:00
settings chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
snippet chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
sqlez chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
sqlez_macros chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
story chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
storybook Fix more tests 2024-01-23 21:49:05 -08:00
sum_tree Remove license-file from Cargo.toml as it is apparently redundant (#4218) 2024-01-23 17:40:30 +01:00
terminal chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
terminal_view chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
text bugfix: fix LineEnding for windows 2024-01-25 03:16:42 -05:00
theme Fix test error 2024-01-23 21:38:16 -08:00
theme_importer chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
theme_selector chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
ui Revert "Improve completion, action and shared project popovers' layout" (#4233) 2024-01-23 15:34:48 -08:00
util Replace tempdir crate with tempfile 2024-01-24 17:58:09 +00:00
vcs_menu chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
vim Update all links point to community 2024-01-24 15:11:17 -05:00
welcome chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00
workspace Allow prompts to have detail, and use for good 2024-01-24 23:15:37 -07:00
zed Allow prompts to have detail, and use for good 2024-01-24 23:15:37 -07:00
zed_actions chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00