From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7793F429E21 for ; Sat, 29 Oct 2011 03:39:11 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled 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 kmlvxvSKUYUF for ; Sat, 29 Oct 2011 03:39:09 -0700 (PDT) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.31.25]) by olra.theworths.org (Postfix) with ESMTP id 5C5CC431FB6 for ; Sat, 29 Oct 2011 03:39:09 -0700 (PDT) Received: from [87.180.87.168] (helo=stokes.schwinge.homeip.net) by smtprelay02.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1RK6IZ-0005Y0-6P for notmuch@notmuchmail.org; Sat, 29 Oct 2011 12:37:59 +0200 Received: (qmail 28842 invoked from network); 29 Oct 2011 10:37:57 -0000 Received: from kepler.schwinge.homeip.net (192.168.111.7) by stokes.schwinge.homeip.net with QMQP; 29 Oct 2011 10:37:57 -0000 Received: (nullmailer pid 6975 invoked by uid 1000); Sat, 29 Oct 2011 10:37:56 -0000 From: Thomas Schwinge To: notmuch@notmuchmail.org Subject: [PATCH] dump: Don't sort. Date: Sat, 29 Oct 2011 12:37:37 +0200 Message-Id: <1319884657-5574-1-git-send-email-thomas@schwinge.name> X-Mailer: git-send-email 1.7.6.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Df-Sender: dGhvbWFzQHNjaHdpbmdlLm5hbWU= 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: Sat, 29 Oct 2011 10:39:11 -0000 From: Thomas Schwinge This improves usage experience considerably in the given scenario. --- Hi! I decided that it'd be useful to put the reasoning and data right next to the source code (as opposed to putting it into the commit message), for the next guy to read this code has it all in one place. Grüße, Thomas --- notmuch-dump.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/notmuch-dump.c b/notmuch-dump.c index 7e7bc17..a431e23 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -45,7 +45,12 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[]) fprintf (stderr, "Out of memory\n"); return 1; } - notmuch_query_set_sort (query, NOTMUCH_SORT_MESSAGE_ID); + /* This used to use NOTMUCH_SORT_MESSAGE_ID. On 2011-10-29, a measurement + * on a 372981 messages instance showed that wall time can be reduced from + * 28 minutes (sorted by Message-ID) to 15 minutes (unsorted), the latter + * being much more ``database-disk-layout-friendly''. Subsequently sorting + * the 25 MiB of data is a no-brainer, if required. */ + notmuch_query_set_sort (query, NOTMUCH_SORT_UNSORTED); if (argc) { output = fopen (argv[0], "w"); -- tg: (3bafdfc..) t/dump_unsorted (depends on: baseline)