unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jameson Graef Rollins <jrollins@finestructure.net>
To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
Subject: Re: Notmuch Pick
Date: Tue, 19 Jun 2012 11:52:01 -0700	[thread overview]
Message-ID: <87zk7z2kz2.fsf@servo.finestructure.net> (raw)
In-Reply-To: <87mx3zok3d.fsf@qmul.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 5119 bytes --]

On Tue, Jun 19 2012, Mark Walters <markwalters1009@gmail.com> wrote:
> As you say several tests do need fixing: I
> thought I would leave that until people said they were basically happy
> with the change. 

Yeah, but failing tests are basically a non-starter for me.  You can
maybe get away with not adding new tests during development, but I'm
unlikely to even try out the patches if a bunch of the existing tests
are failing.

> I am not sure about sanity tests for pick: how would that work while it
> lives in contrib? Obviously it would need some tests before coming in to
> proper mainline.

Since you're not actually submitting these patches yet, does it really
need to live in contrib?  The goal is for it to ultimately *not* live in
contrib, so I would say just go ahead and make them apply in the main
source.

An example of a sanity test I'm talking about is simply display the pick
thread for something and test that it looks like expected.  Sort of a
zeroth order thing.  There are other emacs tests that do the same sort
of thing so it shouldn't be too hard to add.

>> Would it also be useful to make this same change for the search out, for
>> consistency?  I notice the search output now uses newlines between all
>> fields, which should help for asynchronous processing, but it might be
>> nice to put newline separators between the initial and final brackets as
>> well.
>
> Right. 

I would say go ahead and send to the list any patches that come up in
development that are generally useful.  Especially if they're small like
this they are likely to applied before this series, so it will be
smaller and easier to read when the times comes.

>> df97df62b70b884a1cd367360ed6ff7eda0e8af6
>>     cli: add --headers_only option to notmuch-show.c
>>
>> Your comment in this patch is very interesting:
>>
>>     This is used by notmuch-pick.el (although not needed) because it gives a
>>     speed-up of at least a factor of a two; moreover it reduces the memory
>>     usage in emacs hugely.
>>
>> The only difference between the regular show json output and the
>> --headers-only output, as far as I can tell, is the presence of the
>> content of text/plain parts if they exist in the message.  We previously
>> had a discussion about the show output not including any part bodies at
>> all, but we decided that the inclusion of text/plain bodies shouldn't
>> affect anything, so why not include them.  If they actually do, then I
>> argue we should just move to having show json not include any body parts
>> at all by default, and just have them be retrieved individually like we
>> do currently for non-text/plain parts.  This would make things cleaner,
>> and would get rid of the need to have this extra option, which really
>> doesn't produce a significantly different output.
>
> For one use of pick (displaying the structure of a single thread) this
> is not important (and the asynchronous stuff is irrelevant too). For
> another use of displaying the thread structure of a whole "folder" of
> messages it is important. For example the output of 
>
> notmuch show tag:notmuch
>
> is about 70MB on my system, whereas with the --headers-only option this
> drops to about 7MB. Note Emacs uses substantially  more than this much
> memory to actually process the JSON, and on a low-powered laptop this
> is enough to cause a swap-storm.
>
> Your suggestion of just not including the text/plain is nice for
> notmuch-pick, and is very simple (a single line change). However, it
> does seem to slow the emacs show mode down noticeably on large threads
> (something like 2s to 4s on a thread with 180 messages) so I worry that
> this change might annoy people. What do you think?

Threads that long are already a bit of a pain to deal with.  But I think
this reveals a weakness in the way we're displaying threads more than
anything.  It seems silly to me that we would retrieve all 180 messages
From such a thread, and format all of them, only to then hide all but
the one that the reader is seeing.  I think this "pick" series
illustrates this nicely.  Maybe it would be better to refactor the
current emacs show mode to only retrieve parts for messages that are
being displayed.  I'm not sure how difficult that would be, though.

I would also like to have access to more of the message headers in show
mode.  For instance, in emacs I want to access more headers with
notmuch-message-headers than are currently available.  Having json
always include all headers might be a bit of a performance hit for some
messages with lots of headers, but it would allow callers access to
headers they don't currently have access to at all.

So I think it would be nice and clean if the default json output
included all the message headers and the message structure, and then
part contents could be retrieved individually.  I imagine show mode
could be restructured such that it could use this efficiently.

jamie.

PS. where did the name "pick" come from?  It doesn't seem to fit with
the functionality to me.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2012-06-19 18:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-17  6:27 Notmuch Pick Mark Walters
2012-06-18 17:14 ` Jameson Graef Rollins
2012-06-19  7:07   ` Mark Walters
2012-06-19 18:52     ` Jameson Graef Rollins [this message]
2012-06-20  1:01       ` Peter Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zk7z2kz2.fsf@servo.finestructure.net \
    --to=jrollins@finestructure.net \
    --cc=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).