mirror of
https://git.sr.ht/~rjarry/aerc
synced 2026-02-17 11:28:16 +01:00
Previously, the notmuch worker's sort() method was using rfc822.MessageInfo() in order to retrieve info about each message for sorting. This method seems to parse the entire body of the message, so it does much more work than needed for sorting. In contrast, the maildir worker's sort() method uses rfc822.MessageHeaders(), which only parses the headers, and is much faster. I noticed that on a large mailbox with ~60k messages, the maildir backend loads in a few seconds, whereas the notmuch backend takes half a minute. This patch switches the notmuch worker's sort() method to use rfc822.MessageHeaders(). It also includes logic to skip sorting if the sort criterion matches that of the notmuch results. Signed-off-by: Rex Fernando <rex@nnphy.me> Acked-by: Robin Jarry <robin@jarry.cc> |
||
|---|---|---|
| .. | ||
| handlers | ||
| imap | ||
| jmap | ||
| lib | ||
| maildir | ||
| mbox | ||
| middleware | ||
| notmuch | ||
| types | ||
| handler_notmuch.go | ||
| worker.go | ||
| worker_enabled.go | ||