-
Notifications
You must be signed in to change notification settings - Fork 33.4k
feat: time the different search providers #252700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added clarification comments.
// Only log the elapsed time if there are actual results. | ||
if (result && result.filterMatches.length > 0) { | ||
const elapsed = this.stopWatch.elapsed(); | ||
this.logSearchPerformance(LLM_RANKED_SEARCH_PROVIDER_NAME, elapsed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few reasons why a user wouldn't get any LLM_RANKED results, so we wrap this code in an if statement for now.
if (token.isCancellationRequested) { | ||
// Handle cancellation like this because cancellation is lost inside the search provider due to async/await | ||
return null; | ||
} | ||
|
||
// Only log the elapsed time if there are actual results. | ||
if (result && result.filterMatches.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this if statement to be consistent with the one for LLM_RANKED results.
It is probably safe to remove the if statement for local and TF-IDF search providers, and to keep it for the less-available embeddings search provider, but that complicates the if statement and could alter the reported times.
No description provided.