Closed paretje closed 4 years ago
can you explain why this should fix the slowness issue? it looks to me that you're just caching calls to those methods that read the email from disk. I thought the problem was that the message is read from disk in the first place, instead of getting the relevant info from notmuch?
Currently Message.mime_part
is set in Message.__init__
. As a result, when Thread.get_authors
calls Thread.get_messages
, the message contents are read from disk. Here, I defined Message.get_mime_part
and Message.set_mime_part
, and the mime part is no longer set during init. As a result, the mime part is only loaded on the first call of Message.get_mime_part
. As Message.get_author
doesn't need the mime part, this fixes the slowness issue.
I'm sorry for the delay. I updated the commit message.
Closes: #1520