Skip to content

Conversation

@isoos
Copy link
Collaborator

@isoos isoos commented Dec 11, 2024

  • This is a follow-up on Faster predicate matching with integer tag ids. #8377 to implement the idea where we keep the document index list for each tag.
  • The change itself is mostly neutral on memory, and local benchmark shows about 2-3% improvements in latencies.
  • However, it reduces the "smart" factor (complexity) of the index, and I think this has even further potential for improvement, if we change it to value ranges + pre-sort the document list for the default predicates. (to be explored in a separate PR).

@isoos isoos requested a review from sigurdm December 11, 2024 14:06
late final TokenIndex<IndexedApiDocPage> _apiSymbolIndex;
late final _scorePool = ScorePool(_packageNameIndex._packageNames);
final _tagIds = <String, int>{};
final _tagDocumentIndexes = <String, List<int>>{};
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit

Suggested change
final _tagDocumentIndexes = <String, List<int>>{};
final _tagDocumentIndices = <String, List<int>>{};

late final TokenIndex<IndexedApiDocPage> _apiSymbolIndex;
late final _scorePool = ScorePool(_packageNameIndex._packageNames);
final _tagIds = <String, int>{};
final _tagDocumentIndexes = <String, List<int>>{};
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a dartdoc explaining what gets mapped to what here?

@isoos isoos merged commit 94e88bc into dart-lang:master Dec 12, 2024
32 checks passed
@isoos isoos deleted the search-tags branch December 12, 2024 14:43
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