tweaking indexing performance (experimental)

72 views
Skip to first unread message

Dirk-Jan C. Binnema

unread,
Jul 24, 2016, 6:40:40 AM7/24/16
to mu-di...@googlegroups.com
Hi all,

mu's indexing has two phases; the mu-index manpage has some more
details, but roughly:
i) check all leaf directories under Maildir for messages that are not
yet in the database, or have changed
ii) remove any message from the database that is no longer in the
file system

This is quite thorough, and takes care of various cases where the
Maildir has been changed without updating the database (basically, all
changes to your Maildir except through mu4e, 'mu add', 'mu remove').

This thoroughness is the default behavior, but comes at a performance
price. So, for a long time mu has had the --nocleanup flag, which skips
step ii) above.

I've now added something to help with i): the --lazy-check flag. When
using this, mu only checks the dir time-stamps of the cur/ and new/
leaf-directories in your Maildirs. This catches all newly added/removed
messages, but e.g. not any edited messages outside mu4e.

In practice, mu would only miss some corner-cases, and you can of course
occasionally run a thorough index to catch those as well. However, and
that's what this is about, --lazy-check (and --nocleanup) make indexing
much faster.

I've also made this accessible through mu4e; you can try the below
snippet in your configuration:

--8<---------------cut here---------------start------------->8---
;; indexing performance tweaking -- see mu-index(1) for details
(setq
;; index in lazy-check mode; only check the maildir dirstamps
mu4e-index-lazy-check t
;; don't run the cleanup phase after indexing
mu4e-index-cleanup nil)
--8<---------------cut here---------------end--------------->8---

You need mu from git, and note that this is experimental.

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Toby Gee

unread,
Jul 24, 2016, 3:49:08 PM7/24/16
to mu-discuss
Thank you very much for doing this - this makes a huge difference in my usage, and seems to be working perfectly.

Nico Schottelius

unread,
Jul 28, 2016, 3:00:34 PM7/28/16
to mu-discuss
Hey Dirk,

just checked out the new git code and will test it the next days.

Best regards,

Nico
Reply all
Reply to author
Forward
0 new messages