]> git.notmuchmail.org Git - notmuch/commit
Do not defer maildir flag synchronization for new messages
authorAustin Clements <amdragon@mit.edu>
Wed, 26 Jan 2011 11:52:54 +0000 (21:52 +1000)
committerCarl Worth <cworth@cworth.org>
Wed, 26 Jan 2011 11:52:54 +0000 (21:52 +1000)
commitde2acbd49c8fdb0c5bc28513283a9e12eefdaca3
tree9b31189714920394db64ec3b2baeab8151de1398
parent4aeb291c783c18d0c63277275f67798f227e3017
Do not defer maildir flag synchronization for new messages

This is a simplified version of a patch originally by Michal Sojka
<sojkam1@fel.cvut.cz> which is designed to have the same performance
benefits. Michal said the following:

  When notmuch new is run for the first time, it is not necessary to
  defer maildir flags synchronization to later because we already know
  that no files will be removed.

  Performing the maildinr flag synchronization immediately after the
  message is added to the database has the advantage that the message
  is likely hot in the disk cache so the synchronization is faster.
  Additionally, we also save one database query for each message,
  which must be performed when the operation is deferred.

  Without this patch, the first notmuch new of 200k messages (3 GB)
  took 1h and 46m out of which 20m was maildir flags
  synchronization. With this patch, the whole operation took only 1h
  and 36m.

Unlike Michal's patch, this version does the deferral for any new
message, rather than doing it only on the first run of "notmuch new".
notmuch-new.c