[PATCH] dump: Don't sort.

Thomas Schwinge thomas at schwinge.name
Sat Oct 29 03:37:37 PDT 2011


From: Thomas Schwinge <thomas at schwinge.name>

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)


More information about the notmuch mailing list