On Tue, 3 Jan 2012 20:29:06 +0200, Jani Nikula <jani@nikula.org> wrote: > Optimize thread archiving by combining all the -inbox tagging operations to > a single "notmuch tag" call. Also skip redisplay of tag changes in current > buffer, as it is immediately killed by the archiving functions. > > For threads in the order of tens or a hundred inbox tagged messages, this > gives a noticeable speedup. > > On the downside, IIRC Xapian does not perform very well if the query (in > this case a lot of message-ids OR'd together) is very big. It is unknown to > me at which point this approach would become slower than the original one > by one tagging approach, if ever. > > Also, this introduces a limitation to the number of messages that can be > archived at the same time (through ARG_MAX limiting the command line). At > least on Linux this seems more like a theoretical limitation than a real > one. IIRC some systems have like 32768 byte command line limit. If the change did tagging in like 100-message batches then this limit is hardly exceeded (if message-id's max 80 characters then command line is 8000+ bytes)... Hmm -- is there a length limit for message-id. If not maybe when appending message id's keep counting length and tag in batches based on that lenght value. Hundreds of messages per tagging operation instead of one is good improvements. > Signed-off-by: Jani Nikula <jani@nikula.org> Tomi