Chapter 7. Performance tuning

Mutt's performance when reading mailboxes can be improved in two ways:

  1. For remote folders (IMAP and POP) as well as folders using one-file-per message storage (Maildir and MH), mutt's performance can be greatly improved using header caching. Using a single database per folder may further increase performance.

  2. Mutt provides the readinc and writeinc variables to specify at which rate to update progress counters. If these values are too low, mutt may spend more time on updating the progress counter than it spends on actually reading/writing folders.

    For example, when opening a maildir folder with a few thousand messages, the default value for readinc may be too low. It can be tuned on on a folder-basis using folder-hooks:

    # use very high $read_inc to speed up reading hcache'd maildirs
    folder-hook . 'set read_inc=1000'
    # use lower value for reading slower remote IMAP folders
    folder-hook ^imap 'set read_inc=100'
    # use even lower value for reading even slower remote POP folders
    folder-hook ^pop 'set read_inc=1'

These settings work on a per-message basis. However, as messages may greatly differ in size and certain operations are much faster than others, even per-folder settings of the increment variables may not be desirable as they produce either too few or too much progress updates. Thus, Mutt allows to limit the number of progress updates per second it'll actually send to the terminal using the timeinc variable.