1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2026-02-17 11:28:16 +01:00
aerc/worker/notmuch
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
..
lib notmuch: only read message headers when sorting 2026-02-10 11:06:15 +01:00
eventhandlers.go worker: add directory and filter metadata to response messages 2026-02-09 14:46:27 +01:00
message.go notmuch: only read message headers when sorting 2026-02-10 11:06:15 +01:00
message_test.go notmuch: add strategies for multi-file messages 2024-04-02 22:22:28 +02:00
notmuch.go notmuch: set the "passed" tag when forwarding msgs 2024-08-20 11:54:34 +02:00
search.go completion: display descriptions next to choices 2024-10-23 10:22:51 +02:00
worker.go notmuch: only read message headers when sorting 2026-02-10 11:06:15 +01:00