[PATCH] Store "from" and "subject" headers in the database.

Jani Nikula jani at nikula.org
Sun Nov 6 14:30:01 PST 2011


On Sun, 6 Nov 2011 17:01:14 -0500, Austin Clements <amdragon at mit.edu> wrote:
> On Sun, Nov 6, 2011 at 4:07 PM, Jani Nikula <jani at nikula.org> wrote:
> > On Sun,  6 Nov 2011 12:17:36 -0500, Austin Clements <amdragon at MIT.EDU> wrote:
> >> Taking full advantage of this requires a database rebuild, but it will
> >> fall back to the old behavior for messages that do not have headers
> >> stored in the database.
> >
> > ...what's the most convenient way of rebuilding the database while
> > preserving my tags etc.? If this was merged, would an older version of
> > notmuch choke on the rebuilt database with these headers? (To me it
> > looks like it would be fine.)
> 
> The standard way to rebuild the database is to do a notmuch dump, move
> .notmuch out of the way, notmuch new, then notmuch restore.  Some day
> this process should be made automatic.
> 
> Old versions of notmuch will be blissfully unaware of the new headers
> stored in the database.  They can even safely add messages to an
> upgraded database without breaking new versions of notmuch.

Hi, I ran a quick test with/without the patch. I don't have much mail,
but on my aging laptop the performance increase is significant. See
below. 'du -h' on the .notmuch dir increased from 82M to 83M with the
patch, IMHO well worth it.


BR,
Jani.


WITHOUT THE PATCH:

$ sudo bash -c "/bin/sync; /bin/echo 3 > /proc/sys/vm/drop_caches"
$ time notmuch search "*" | wc -l
8167

real	0m43.216s
user	0m3.860s
sys	0m2.268s
$ time notmuch search "*" | wc -l
8167

real	0m2.762s
user	0m2.196s
sys	0m0.564s

WITH THE PATCH:

$ sudo bash -c "/bin/sync; /bin/echo 3 > /proc/sys/vm/drop_caches"
$ time notmuch search "*" | wc -l
8167

real	0m8.019s
user	0m2.088s
sys	0m0.720s
$ time notmuch search "*" | wc -l
8167

real	0m2.033s
user	0m1.592s
sys	0m0.440s


More information about the notmuch mailing list