Skip to content

commands/search/tag: Narrow search down to needed messages#1688

Open
guludo wants to merge 1 commit intopazz:masterfrom
guludo:pr/tag-command-narrow-search
Open

commands/search/tag: Narrow search down to needed messages#1688
guludo wants to merge 1 commit intopazz:masterfrom
guludo:pr/tag-command-narrow-search

Conversation

@guludo
Copy link
Contributor

@guludo guludo commented Dec 26, 2024

For some reason, tagging long threads is taking a lot of time in my system. It might be related to the python library for notmuch, since doing the same directly from notmuch CLI is usually fast.

In some use cases (e.g. archiving), most of the messages in the thread might already contain the tags being added or removed. We can optimize for this case by narrowing down the search to only the messages that need the update.

So, while the slow tagging operation should be properly investigated at the library level, we can proactively optimize the testquery, which is beneficial anyway.

For some reason, tagging long threads is taking a lot of time in my
system. It might be related to the python library for notmuch, since
doing the same directly from notmuch CLI is usually fast.

In some use cases (e.g. archiving), most of the messages in the thread
might already contain the tags being added or removed. We can optimize
for this case by narrowing down the search to only the messages that
need the update.

So, while the slow tagging operation should be properly investigated at
the library level, we can proactively optimize the testquery,
which is beneficial anyway.
@pazz pazz requested a review from Copilot April 6, 2025 13:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +219 to +220
logging.warning('unandled action %s', self.action)

Copy link

Copilot AI Apr 6, 2025

Choose a reason for hiding this comment

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

Typo detected in the log message: 'unandled' should be 'unhandled'.

Suggested change
logging.warning('unandled action %s', self.action)
logging.warning('unhandled action %s', self.action)

Copilot uses AI. Check for mistakes.
@pazz pazz requested a review from Copilot April 6, 2025 13:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +219 to +220
logging.warning('unandled action %s', self.action)

Copy link

Copilot AI Apr 6, 2025

Choose a reason for hiding this comment

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

Typo in the warning message: consider changing 'unandled' to 'unhandled'.

Suggested change
logging.warning('unandled action %s', self.action)
logging.warning('unhandled action %s', self.action)

Copilot uses AI. Check for mistakes.
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