Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C8286418C36 for ; Thu, 15 Apr 2010 23:38:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JScGQ97oeoq2 for ; Thu, 15 Apr 2010 23:38:56 -0700 (PDT) Received: from homiemail-a20.g.dreamhost.com (caiajhbdcaib.dreamhost.com [208.97.132.81]) by olra.theworths.org (Postfix) with ESMTP id 52CA2431FC1 for ; Thu, 15 Apr 2010 23:38:56 -0700 (PDT) Received: from localhost.localdomain (unknown [195.190.188.219]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id 0CB017EC060; Thu, 15 Apr 2010 23:38:54 -0700 (PDT) From: Sebastian Spaeth To: Notmuch developer list Subject: [PATCH 3/3] notmuch-tag: don't sort messages before applying tag changes Date: Fri, 16 Apr 2010 08:38:48 +0200 Message-Id: <1271399928-6166-3-git-send-email-Sebastian@SSpaeth.de> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <87eiifj433.fsf@SSpaeth.de> References: <87eiifj433.fsf@SSpaeth.de> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 06:38:58 -0000 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 --- 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