Hi,

Since commit c7b28419abd9 ("* bugfix for issue 164" [1]) I have
experienced a slowdown when displaying messages in threaded format.

Has anyone else also noticed that showing threads takes now longer
than before? (Mentioned change was merged on 2014-03-20.)

On a 16k maildir, using mu from master @ c7b2841, threading and
sorting by date takes:

$ 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):

       5242.073458      task-clock (msec)         #    1.000 CPUs utilized      
      ( +-  0.50% )

       5.244428658 seconds time elapsed                                         
 ( +-  0.50% )

While one commit before that (master @ bd9d99a) it takes only:

$ 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% )

I didn't see any way to make the current iterative solution any faster
so I went for it and rewrote it from scratch. Changes are here:

  https://github.com/jsitnicki/mu.git thread-sort [2]

My goal was to get the thread sorting performance back to what it was
before commit c7b2841 and to keep the behavior as is.

After the rewrite the time it takes to sort threads has dropped down
back to a level that I'm happy with:

$ 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):

       1459.883316      task-clock (msec)         #    0.998 CPUs utilized      
      ( +-  0.72% )

       1.462540088 seconds time elapsed                                         
 ( +-  0.77% )

On the way, I've extended mu's test suite for threads to ensure that
that I haven't broken the behavior that commit c7b2841 introduced. So
far everything have been working as expected for me.

Would such an optimization be of interest to any other mu/mu4e users?
If so, then I've submitted a pull request:

  https://github.com/djcb/mu/pull/455

Looking forward to comments and feedback.

Cheers,
Jakub

[1] https://github.com/djcb/mu/commit/c7b28419abd9

[2] https://github.com/jsitnicki/mu/tree/thread-sort

-- 
You received this message because you are subscribed to the Google Groups 
"mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to