]> git.cworth.org Git - notmuch/commitdiff
notmuch-tag: don't sort messages before applying tag changes
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Fri, 16 Apr 2010 06:38:48 +0000 (08:38 +0200)
committerCarl Worth <cworth@cworth.org>
Wed, 21 Apr 2010 23:06:09 +0000 (16:06 -0700)
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

index 8b6f7dc081f4dcd79cba27539ccc0dca9fdfc246..fd54bc786d84d7f910c5916e8c845dea906b5516 100644 (file)
@@ -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))