Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rzhao271
Copy link
Contributor

No description provided.

@rzhao271 rzhao271 self-assigned this Jun 27, 2025
@rzhao271 rzhao271 added this to the June 2025 milestone Jun 27, 2025
@rzhao271 rzhao271 requested a review from sbatten June 27, 2025 20:52
Copy link
Contributor Author

@rzhao271 rzhao271 left a 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);
Copy link
Contributor Author

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) {
Copy link
Contributor Author

@rzhao271 rzhao271 Jun 27, 2025

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.

@rzhao271 rzhao271 marked this pull request as ready for review June 27, 2025 21:00
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.

1 participant