unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: notmuch@notmuchmail.org
Subject: Re: [PATCH 3/4] Optimize thread search using matched docid sets.
Date: Thu, 18 Nov 2010 02:38:29 -0500	[thread overview]
Message-ID: <20101118073828.GD2439@mit.edu> (raw)
In-Reply-To: <20101117192826.GU2439@mit.edu>

Currently this code uses a bitmap indexed by docid as a simple, fast
set structure.  This is quite memory-efficient if the docid space is
dense, even if the largest docid is quite large.  Is there a danger
that the docid space will be large and sparse?  Is it worth replacing
this with a smarter bit set structure?

Quoth myself on Nov 17 at  2:28 pm:
> This reduces thread search's 1+2t Xapian queries (where t is the
> number of matched threads) to 1+t queries and constructs exactly one
> notmuch_message_t for each message instead of 2 to 3.
> notmuch_query_search_threads eagerly fetches the docids of all
> messages matching the user query instead of lazily constructing
> message objects and fetching thread ID's from term lists.
> _notmuch_thread_create takes a seed docid and the set of all matched
> docids and uses a single Xapian query to expand this docid to its
> containing thread, using the matched docid set to determine which
> messages in the thread match the user query instead of using a second
> Xapian query.
> 
> As a side effect, this fixes author order so authors are always sorted
> by first occurrence in each thread.  This breaks two emacs tests that
> hard-code the old, buggy author order.
> 
> This reduces the amount of time required to load my inbox from 4.523
> seconds to 3.025 seconds (1.5X faster).

  reply	other threads:[~2010-11-18  7:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17 19:28 [PATCH 3/4] Optimize thread search using matched docid sets Austin Clements
2010-11-18  7:38 ` Austin Clements [this message]
2010-12-08  1:20   ` Carl Worth
2010-12-08  1:19 ` Carl Worth
2010-12-08 21:58   ` Austin Clements
2010-12-08 22:01     ` [PATCH] Various small clean-ups to doc ID set code Austin Clements
2011-01-28 21:36       ` Carl Worth
2011-01-31  4:22         ` [PATCH v2 0/2] Small clean-ups to the " Austin Clements
2011-03-09 23:21           ` Carl Worth
2011-03-10  1:31             ` Austin Clements
2011-01-31  4:22         ` [PATCH 1/2] Remove code repetition in the doc ID bitmap code Austin Clements
2011-01-31  4:22         ` [PATCH 2/2] Simplify _notmuch_doc_id_set_init interface Austin Clements
2011-01-28 21:26     ` [PATCH 3/4] Optimize thread search using matched docid sets Carl Worth

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=20101118073828.GD2439@mit.edu \
    --to=amdragon@mit.edu \
    --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).