1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2026-02-17 11:28:16 +01:00
aerc/worker
Rex Fernando 2682f58ed8 notmuch: only read message headers when sorting
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>
2026-02-10 11:06:15 +01:00
..
handlers watchers: move filesystem monitoring stuff in lib 2023-08-04 11:32:40 +02:00
imap imap: store directory information in header cache 2026-02-10 09:03:34 +01:00
jmap jmap: add constants for state types 2026-02-09 14:46:27 +01:00
lib treewide: run go modernize 2025-12-20 18:06:30 +01:00
maildir maildir: centralize error and response handling 2026-02-09 14:46:27 +01:00
mbox mbox: centralize error and response handling 2026-02-09 14:46:27 +01:00
middleware worker: add directory and filter metadata to response messages 2026-02-09 14:46:27 +01:00
notmuch notmuch: only read message headers when sorting 2026-02-10 11:06:15 +01:00
types worker: add directory and filter metadata to response messages 2026-02-09 14:46:27 +01:00
handler_notmuch.go treewide: run go modernize 2025-12-20 18:06:30 +01:00
worker.go worker: pass message channel explicitly to constructor 2026-02-09 14:46:27 +01:00
worker_enabled.go watchers: move filesystem monitoring stuff in lib 2023-08-04 11:32:40 +02:00