1
0
mirror of https://github.com/djcb/mu.git synced 2024-06-20 06:46:50 +02:00
Commit Graph

15 Commits

Author SHA1 Message Date
Jakub Sitnicki
97101f1f82 mu: Prune empty container when an only child gets promoted to the root set 2014-07-15 07:25:51 +02:00
Jakub Sitnicki
f724f4a57d mu: Consider an empty container to be less than anything else
Reasoning being that, arguably, it is the least surprising thing to do.
2014-07-15 07:25:50 +02:00
Jakub Sitnicki
dc3be515af mu: Extract function for comparing two containers 2014-07-15 07:25:50 +02:00
Jakub Sitnicki
d93b8135a6 Revert "* bugfix for issue 164"
This reverts commit c7b28419ab.

The reverted change fails to sort threads correctly when there is an
empty container, serving as a parent to orphan messages, in the thread
tree as demonstrated by the test in commit f49296759e ("tests:
threads: Test if orphan message promotes its thread").

Also, the reverted commit introduces a performance hit. The time it
takes to sort threads has increased roughly by a factor of 4.

Current state:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       4967.692519      task-clock (msec)         #    1.000 CPUs utilized            ( +-  0.14% )

       4.969247128 seconds time elapsed                                          ( +-  0.14% )

With the reverted patch applied:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       1231.761588      task-clock (msec)         #    0.996 CPUs utilized            ( +-  1.02% )

       1.236209133 seconds time elapsed                                          ( +-  1.08% )

The benchmark was ran on a maildir with ~16k messages:

$ mu find maildir:/INBOX | wc -l
16503
2014-07-15 07:24:56 +02:00
omfgroflbbq
c7b28419ab * bugfix for issue 164 2014-03-20 16:22:50 +01:00
djcb
fa514435ea * merge branch 'master' of github.com:djcb/mu 2013-06-13 23:56:35 +03:00
djcb
855e81db99 * update copyright years 2013-03-30 11:32:07 +02:00
djcb
c5f8ea6451 * use AM_CPPFLAGS instead of INCLUDES 2012-12-22 22:54:50 +02:00
djcb
2f9dd78bb0 * add query flags (which match msgiterflags) to mu_query_run, update callers 2012-12-16 15:08:34 +02:00
djcb
cbbb23c13f * Fixes for the threading algorithm (thanks to Abdó Roig)
The problem was that once a container got a parent, it did not change it anymore
  due to the child_elligible condition, but the parent might have been assigned
  from an incomplete References sequence.

  Now, we make sure the last reference gets to be the message's parent (following
  the JWZ's algorithm), reparenting the message if necessary. This makes sense, as
  the last parent-child relationship (between last ref and the message) is the
  most reliable piece of info here.

  Instead of child_elligible, we now only check that the new parent is not a
  descendant of the current message, to prevent making a loop. Everything else is
  fine, as it only moves a subtree around.
2012-12-09 13:48:22 +02:00
djcb
8ad01e4aa8 * lib: threading: pre-sort the threaded results, add some more comments 2012-10-17 17:59:33 +03:00
djcb
28136a4e04 * cosmetics 2012-09-19 16:56:25 +03:00
djcb
e483291a1d * lib/mu-container: remove some O(n*n) behavior from threading
mu_container_append_siblings was showing up high in profiles as it has to
  walk chains of next->next->next->... pointers to find the last one. we now
  cache the last link in the chain. for listing ~ 23K messages, this saves
  about 20%.
2012-09-17 17:45:59 +03:00
djcb
6bff28a6ff * cosmetics 2012-09-16 13:16:01 +03:00
djcb
46f10cfde9 * refactoring: split src/ into mu/ and lib/ 2012-05-21 09:25:53 +03:00