unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Sebastian Spaeth <Sebastian@SSpaeth.de>
To: Notmuch developer list <notmuch@notmuchmail.org>
Subject: [PATCH 3/3] notmuch-tag: don't sort messages before applying tag changes
Date: Fri, 16 Apr 2010 08:38:48 +0200	[thread overview]
Message-ID: <1271399928-6166-3-git-send-email-Sebastian@SSpaeth.de> (raw)
In-Reply-To: <87eiifj433.fsf@SSpaeth.de>

It's not neccessary to sort the results before we apply tags. Xapian
contributor Olly Betts says that savings might be bigger with a cold
file cache and (as unsorted implies really sorted by document id) a better
cache locality when applying tags to messages.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
---
 notmuch-tag.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/notmuch-tag.c b/notmuch-tag.c
index 8b6f7dc..fd54bc7 100644
--- a/notmuch-tag.c
+++ b/notmuch-tag.c
@@ -107,6 +107,9 @@ notmuch_tag_command (void *ctx, unused (int argc), unused (char *argv[]))
 	return 1;
     }
 
+    /* tagging is not interested in any special sort order */
+    notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED);
+
     for (messages = notmuch_query_search_messages (query);
 	 notmuch_messages_valid (messages) && !interrupted;
 	 notmuch_messages_move_to_next (messages))
-- 
1.7.0.4

  parent reply	other threads:[~2010-04-16  6:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14  6:30 [PATCH] allow to not sort the search results Sebastian Spaeth
2010-04-14  6:55 ` Jason White
2010-04-14  7:51   ` Sebastian Spaeth
2010-04-15 12:54     ` Olly Betts
2010-04-16  6:37       ` Sebastian Spaeth
2010-04-16  6:38         ` [PATCH 1/3] query.cc: allow to return query results unsorted Sebastian Spaeth
2010-04-16  6:38         ` [PATCH 2/3] notmuch-search: Introduce --sort=unsorted Sebastian Spaeth
2010-04-16  6:38         ` Sebastian Spaeth [this message]
2010-04-16  6:58         ` [PATCH] allow to not sort the search results Olly Betts
2010-04-18 13:56         ` Sebastian Spaeth
2010-04-21 23:09           ` Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1271399928-6166-3-git-send-email-Sebastian@SSpaeth.de \
    --to=sebastian@sspaeth.de \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).