Skip to content

Conversation

@marcocondrache
Copy link
Contributor

Release Notes:

  • N/A

Signed-off-by: Marco Mihai Condrache <[email protected]>
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 24, 2025
Copy link
Contributor

@osiewicz osiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, we're not really avoiding an allocation in one of those cases (calling get_matches still allocates). If you're really after reducing allocations, you can do so without altering the API of update_match_index with some finnickery inside of that function.
45633.patch

@marcocondrache
Copy link
Contributor Author

marcocondrache commented Dec 25, 2025

@osiewicz That patch is incorrect. highlight_matches can’t be called from inside the entity update because contexts are of different types.

Also, the selection-change path is only triggered by user clicks/selections, whereas entity_changed is invoked much more frequently. For context, entity_changed gets called hundreds of times during large searches.

Because of that, update_match_index ends up doing unnecessary allocations when it could instead borrow the already-cloned data from entity_changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants