| Age | Commit message (Collapse) | Author |
|
|
|
https://trac.xapian.org/ticket/850
|
|
This change adds a new cleanup mode that avoids cleanup having
re-traverse the directories the index pass just looked at.
Additionally, we efficiently query the Xapian database by walking the
term list instead of doing multiple point-wise path lookups.
I'd noticed that most of my time in mu's cleanup pass consisted of
B-tree lookups in Xapian (one 8KB pread64 at a time). The point
lookups forced Xapian to traverse from the root of the B-tree to the
leaf for every single message. Additionally, in order to join on the
message path, we had to do *another* B-tree traversal after locating
each message term. Now we just walk the terms in order, which is much
more efficient, as we touch each B-tree node only once.
On my system, with 1371861 total messages, the total time of mu
index (no lazy check):
--nocleanup: 3.6s
incremental cleanup: 4.2s (0.6s in cleanup)
legacy cleanup: 5.2s (1.6s in cleanup)
With the new mode, we save 1.0s of the 1.6s cleanup, so we're
~63% faster.
But the incremental cleanup works even better with lazy checking.
If I enable --lazy-check, dirty only my INBOX (360778 messages), and
run index, I get:
--nocleanup: 0.9s
incremental cleanup: 1.1s (0.2s in cleanup)
legacy cleanup: 2.5s (1.6s in cleanup)
We save 1.4s out of 1.6s for ~88% speedup.
This change also fixes a timestamp bug: we should be storing
the *start* time of the index pass in metadata, not the end time, so
that on the next index pass, we notice messages that arrived between
the two times.
All tests pass. You can set the environment variable
MU_NO_INCREMENTAL_CLEANUP to use the legacy cleanup path instead.
|
|
They don't add much value, let's remove.
Rework clear_labels in terms of update_labels.
|
|
This does make removing a bit slower...
|
|
Split labels-cache and store-labels.
|
|
E.g. with unexpected termination for mu it is possible that the
labels-cache (i.e., the one that is used for auto-completion) gets disconnected
from reality.
Add a --restore option to `mu label list` to restore the actual labels from the
labels seen in the store.
|
|
For triggering saving the contacts / labels caches.
|
|
In particular, clear_labels
And some cosmetics
|
|
When re-initializing the store, automatically write the labels to a file in mu's
cache, so user can later import them.
|
|
Move the import/export code to 'lib'.
|
|
Add methods update_labels, clear_labels which update or clear the labels for a
message in the store, and update the cache with the overall counts of labels.
Add a LabelsCache to keep track of the counts and labels_map() to retrieve that
map.
|
|
We're not using it.
|
|
store-worker is a thread + async queue to throttle requests to a single thread.
|
|
Simplify xapian-db: locks should go elsewhere; transaction level add
too much complication.
|
|
Ensure we use the user-specified batch-size immediately after db creation.
|
|
Add store::consume_message, which is like add message but std::move from
the caller such that the messages longer has copies (with
Xapian::Document) on the caller side; this is to avoid threading issues.
|
|
From CI.
|
|
|
|
HT: Arsen Arsenović
Fixes #2633.
|
|
Instead of handling transactions in the store, handle it in xapian-db.
Make the code a bit more natural / cleaner-out
Handle transaction automatically (with a batch-size) and add some RAII
Transaction object, which makes all database interaction transactable
for the duration. So, no more need for explicit parameters to
add_message while indexing.
|
|
sort results (for testing)
with the ChangeName flag, also apply to dup messages.
|
|
Add sub-command to move messages; add tests and docs.
Fixes #157
|
|
...and xapian-db gets a small API update, update store as well.
|
|
Only a few for now.
|
|
simplify things a bit
|
|
Xapian supports an "ngrams" option to help with languages/scripts
without explicit wordbreaks, such as Chinese / Japanese / Korean.
Add some plumbing for supporting this in mu as well. Experimental for
now.
|
|
This gets the current list of maildirs by asking the scanner to do a
file-system search.
|
|
Update test cases as well.
|
|
*Usually* we need Xapian's replace_document() API, but when we know a
document (message) is completely new, we can use the faster
add_document(). That is the case with the initial (re)indexing, when
start with an empty database.
Also a few smaller cleanups.
|
|
Modernize.
|
|
No need for two near-identical impls
Remove some dead declarations.
|
|
No need for "pimpl" in xapian-db; keep it simple.
|
|
Other code depends on that.
|
|
xapian-db does it, no longer needed in store.cc
|
|
Not complete, but a first big stab converting users of Mu::Error and
various g_warning & friends, format to the new libfmt-based APIs.
|
|
Simplifies the implementation.
|
|
Remove readonly/inmemory from properties. Add read_only() accessor.
|
|
|
|
It was getting old...
Remove the unused parts, refactor the few parts still in use.
|
|
|
|
Update the move_message API so to allow for updating duplicate messages
too (not implemented yet), and return all updated messages.
|
|
And use improved cached_sexp api (automatically handled with
mu-document now)
|
|
indexer_ is holding a ptr to the _old_ store; clear it so it gets
regenerated.
|
|
Support reinitializing, based on some current store. This is useful for
upgrading. Note that this is only the backend implementation + tests.
|
|
Remove some dead/unused code. Update docs. Add test cases.
|
|
|
|
Remove unused library code; recycle some electrons.
|
|
This cause havoc / race conditions.
|
|
Clear it up as soon as possible.
|