unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch-show-mode: slowdown due to redisplay
@ 2021-12-07  8:38 Rainer Gemulla
  2021-12-07 16:56 ` David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer Gemulla @ 2021-12-07  8:38 UTC (permalink / raw)
  To: notmuch

Navigating certain messages (e.g., with many attachments or images) may become very slow in notmuch-show-mode. I see this rarely, but when it happens, it takes >1s to simply move the point so that the buffer is barely usable. The CPU profiler shows that notmuch-show-command-hook calls redisplay and that's that all where the time goes. Not sure if anything can be done about this.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-show-mode: slowdown due to redisplay
  2021-12-07  8:38 notmuch-show-mode: slowdown due to redisplay Rainer Gemulla
@ 2021-12-07 16:56 ` David Bremner
  2021-12-08 11:15   ` Rainer Gemulla
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2021-12-07 16:56 UTC (permalink / raw)
  To: Rainer Gemulla, notmuch

Rainer Gemulla <hqn1@gmx.de> writes:

> Navigating certain messages (e.g., with many attachments or images)
> may become very slow in notmuch-show-mode. I see this rarely, but when
> it happens, it takes >1s to simply move the point so that the buffer
> is barely usable. The CPU profiler shows that
> notmuch-show-command-hook calls redisplay and that's that all where
> the time goes. Not sure if anything can be done about this.

Hmm. Hard to debug without a sample message, or a more definite
pattern. Do you notice a threshold in terms of numbers of attachements?
I can imagine there is some bad behaviour involving large numbers of
buttons when running redisplay.

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-show-mode: slowdown due to redisplay
  2021-12-07 16:56 ` David Bremner
@ 2021-12-08 11:15   ` Rainer Gemulla
  2021-12-08 14:23     ` David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer Gemulla @ 2021-12-08 11:15 UTC (permalink / raw)
  To: David Bremner, notmuch

>> Navigating certain messages (e.g., with many attachments or images)
>> may become very slow in notmuch-show-mode. I see this rarely, but when
>> it happens, it takes >1s to simply move the point so that the buffer
>> is barely usable. The CPU profiler shows that
>> notmuch-show-command-hook calls redisplay and that's that all where
>> the time goes. Not sure if anything can be done about this.
>
> Hmm. Hard to debug without a sample message, or a more definite
> pattern. Do you notice a threshold in terms of numbers of attachements?
> I can imagine there is some bad behaviour involving large numbers of
> buttons when running redisplay.

I've tracked it down: it happens when multiple large images are attached to the email (and displayed inline) and global-hl-line-mode is turned on. The former slows down redisplay, the latter makes redisplay do something with every cursor movement.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-show-mode: slowdown due to redisplay
  2021-12-08 11:15   ` Rainer Gemulla
@ 2021-12-08 14:23     ` David Bremner
  2021-12-08 15:14       ` Rainer Gemulla
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2021-12-08 14:23 UTC (permalink / raw)
  To: Rainer Gemulla, notmuch

Rainer Gemulla <hqn1@gmx.de> writes:

>
> I've tracked it down: it happens when multiple large images are
> attached to the email (and displayed inline) and global-hl-line-mode
> is turned on. The former slows down redisplay, the latter makes
> redisplay do something with every cursor movement.

I made a test message with 10 copies of a (black and white) 3k x 3k
jpeg image, enabled global-hl-line-mode, but I don't notice any
navigation problems. I wonder if there could be an interaction with some
other package? Or do I need bigger / more images?

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-show-mode: slowdown due to redisplay
  2021-12-08 14:23     ` David Bremner
@ 2021-12-08 15:14       ` Rainer Gemulla
  0 siblings, 0 replies; 5+ messages in thread
From: Rainer Gemulla @ 2021-12-08 15:14 UTC (permalink / raw)
  To: David Bremner, Rainer Gemulla, notmuch


[-- Attachment #1.1: Type: text/plain, Size: 1101 bytes --]


>> I've tracked it down: it happens when multiple large images are
>> attached to the email (and displayed inline) and global-hl-line-mode
>> is turned on. The former slows down redisplay, the latter makes
>> redisplay do something with every cursor movement.
>
> I made a test message with 10 copies of a (black and white) 3k x 3k
> jpeg image, enabled global-hl-line-mode, but I don't notice any
> navigation problems. I wonder if there could be an interaction with some
> other package? Or do I need bigger / more images?

It's not consistent, apparently. I do have a message (with 2 images and multiple PDF attachments) where it looks like this:

       15095  97% - notmuch-show-command-hook
       15095  97%  - redisplay
          16   0%   - redisplay_internal (C function)
          16   0%    - eval
          16   0%       spaceline-ml-main

when global-hl-line-mode is on. Unfortunately, I cannot share this message. Generally, it only happens when one of the attached images is visible in the window.

If I stumble across this problem with a message that I can share, I'll post it here.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 869 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-09 15:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07  8:38 notmuch-show-mode: slowdown due to redisplay Rainer Gemulla
2021-12-07 16:56 ` David Bremner
2021-12-08 11:15   ` Rainer Gemulla
2021-12-08 14:23     ` David Bremner
2021-12-08 15:14       ` Rainer Gemulla

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).