]> git.notmuchmail.org Git - notmuch/commit
n_m_remove_indexed_terms: reduce number of Xapian API calls.
authorDavid Bremner <david@tethera.net>
Tue, 16 Apr 2019 01:46:16 +0000 (22:46 -0300)
committerDavid Bremner <david@tethera.net>
Thu, 23 May 2019 11:00:56 +0000 (08:00 -0300)
commit97939170b3e8b31f88520932aa20bf1b98e469c3
tree0ff346f75a3bbfacc25681fff68a488198d56c38
parent3563079be37737aab084e957b494070eaea9c2f6
n_m_remove_indexed_terms: reduce number of Xapian API calls.

Previously this functioned scanned every term attached to a given
Xapian document. It turns out we know how to read only the terms we
need to preserve (and we might have already done so). This commit
replaces many calls to Xapian::Document::remove_term with one call to
::clear_terms, and a (typically much smaller) number of calls to
::add_term. Roughly speaking this is based on the assumption that most
messages have more text than they have tags.

According to the performance test suite, this yields a roughly 40%
speedup on "notmuch reindex '*'"
lib/message.cc