unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Piotr Trojanek <piotr.trojanek@gmail.com>, notmuch@notmuchmail.org
Subject: Re: High CPU usage on Tree View with many emails
Date: Sat, 24 Jun 2017 16:27:06 -0300	[thread overview]
Message-ID: <87wp81mbjp.fsf@tethera.net> (raw)
In-Reply-To: <CAGExNxE9FHeKQ4+hgk=KQcakTE2_ysg3gP6qupm+Jadq_4i=GQ@mail.gmail.com>

Piotr Trojanek <piotr.trojanek@gmail.com> writes:

> When I make a query that gives many results (e.g. "review", which hits
> ~2200 emails with my Gerrit reviews) and want to display them in Tree
> View, the CPU usage stays high for several seconds.
>
> While this happens, the Emacs window flickers, like it was busy with
> redisplaying the buffer. If I pull the horizontal scroll of the Emacs
> buffer down, I can see that the buffer grows (like messages being
> inserted there). The Emacs profiler says that more than 50% of CPU
> time is spend in notmuch-tree-insert-forest-thread.
>
> Interestingly, the in the non-tree view the same query is processed in no time.
>
I suspect the notmuch-search call is taking longer than you think, but
isn't as annoyoying because of the lack of flicker. You can watch the
notmuch process running in e.g. top to see how long it is running.

I don't really know what's going on there, but I noticed that
notmuch-tree is producing about 3 times as manny calls to
redisplay_internal.

The other thing I observed is that the call to "notmuch show" used by
notmuch-tree takes about 3x as long as the call to "notmuch search" used
by M-x notmuch-search; that's with hot caches. It also produces about 4
x as much output, even using --body=false.

All of those experiments are with a query that returns about 35k messages.

  reply	other threads:[~2017-06-24 19:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 15:34 High CPU usage on Tree View with many emails Piotr Trojanek
2017-06-24 19:27 ` David Bremner [this message]
2017-06-25  8:28 ` Mark Walters

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=87wp81mbjp.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=piotr.trojanek@gmail.com \
    /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).