Skip to content

Conversation

@apotterri
Copy link
Contributor

@apotterri apotterri commented Oct 8, 2024

When indexing files, use debug's argument formatting facility, rather string interpolation.

Also, add map.js and yarn.lock to the file extensions being ignored.

Fixes #2041 .

Add js.map, yarn.lock to the list of binary file extensions.
Copy link
Contributor

@kgilpin kgilpin left a comment

Choose a reason for hiding this comment

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

Repetition of words in a document is used by the scoring algorithm. So it’s actually intentional that terms are duplicated in the index. Repeated occurrence of a term boosts the match score.

The number of times that the word appears in the document is part of the BM25 formula.

https://en.wikipedia.org/wiki/Okapi_BM25

Instead of using string interpolation, which is always executed, use
`debug`'s support for argument formatting, which only evaluates
arguments when debugging is enabled. This speeds up FileIndex.indexFile
considerably for files with many keywords.
@apotterri apotterri force-pushed the index-speedups_20241008 branch from c96783b to 087d63c Compare October 8, 2024 22:31
@apotterri apotterri requested a review from kgilpin October 8, 2024 22:33
@apotterri apotterri merged commit 4c53c16 into main Oct 9, 2024
23 checks passed
@apotterri apotterri deleted the index-speedups_20241008 branch October 9, 2024 18:13
@appland-release
Copy link
Contributor

🎉 This PR is included in version @appland/appmap-v3.169.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navie has trouble answering questions in appmap-intellij-plugin

4 participants