Optimize action/plugin search caching with normalized CachedSearchEntry#930
Merged
multiplex55 merged 3 commits intomasterfrom Mar 14, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
to_lowercase()and temporary string allocations during search and exact-match filtering by pre-normalizing searchable fields.actionid in exact-mode filtering alongsidelabel/desc/aliases.Description
CachedSearchEntrystruct that storeslabel_lc,desc_lc, andaction_lc, and replaced the oldaction_cache: Vec<(String,String)>withaction_cache: Vec<CachedSearchEntry>and addedcommand_search_cache: Vec<CachedSearchEntry>insrc/gui/mod.rs.update_action_cacheandupdate_command_cacheto populate normalized cache entries viaCachedSearchEntry::from_actionso normalization happens once per reload.matches_exact_display_text,search_actions, andsearch_pluginsto consume pre-normalizedCachedSearchEntrydata and to checkaction_lcas an additional exact-match target, while preserving existing plugin-resolved bypass logic.update_pathscallsupdate_command_cacheunconditionally so plugin/settings reloads refresh thecommand_search_cacheand keep caches in sync.Testing
exact_display_match_is_case_insensitive_substring,action_and_command_search_cache_is_normalized, andupdate_paths_refreshes_command_search_cache_for_plugin_reloadinsrc/gui/mod.rsto validate normalized caching and behavior.cargo fmt --all, which completed successfully.cargo test gui::mod::tests:: -- --nocapture, but the test build failed in this environment due to a native dependency error fromalsa-sysrequiring systemalsa/pkg-config(not available here), so full test execution could not complete.cargo fmt --all --checkwas used to ensure formatting; repository formatting differences unrelated to this change were noted during the rollout and addressed by runningcargo fmt.Codex Task