Skip to content

Conversation

@isoos
Copy link
Collaborator

@isoos isoos commented Nov 5, 2024

  • Part of the split of Reduce the memory allocation during search with mutable IndexedScore. #8225.
  • PackageNameIndex.search (used only in tests) is updated to update its filterOnPackages set on subsequent iteration. If this would be used elsewhere, it would probably improve the search by reducing the number of ngram-similarity calculation done by the index.
  • PackageNameIndex.searchWord is updated to not insert entries below the 0.5 score threshold (so we don't need to update the map to remove them later).
  • PackageNameIndex.searchWord also removed scores that were half of the largest score present, but in practice, with the combination of the 0.5 threshold (above) this does not have any further effect, as the maximum it would have removed would be 0.5 anyway. Removing that part is a no-op.
  • The iteration change in the TokenIndex constructor spares us the internal lookup.

@isoos isoos requested review from jonasfj and sigurdm November 5, 2024 17:15
@isoos isoos merged commit a92e6fd into dart-lang:master Nov 6, 2024
32 checks passed
@isoos isoos deleted the search-microopt branch November 6, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants