Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected delay on folder load after scanning messages #4331

Open
madduck opened this issue Jun 14, 2024 · 5 comments
Open

Unexpected delay on folder load after scanning messages #4331

madduck opened this issue Jun 14, 2024 · 5 comments
Labels

Comments

@madduck
Copy link
Contributor

madduck commented Jun 14, 2024

Expected Behaviour

When I open a (large) mailbox (Maildir), I see the progress at the bottom e.g. Reading /home/madduck/mail/store... 141395/419009 (33%). When that reaches 100%, I expect the mailbox to display in the main window without further delay.

Actual Behaviour

When 100% is reached, the progress message disappears. Then, nothing happens for 2–3 seconds, and only then are the messages listed in the main window. This can be seen in following GIF, which I made small to protect my privacy a little bit :)

out

How often does this happen?

  • Always

When did it start to happen?

  • As long as I can remember, since switching from Mutt to Neomutt about 2 years ago.

NeoMutt Version

NeoMutt 20240425-89-194907
Copyright (C) 2015-2024 Richard Russon and friends
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 6.7.9-amd64 (x86_64)
ncurses: ncurses 6.5.20240427 (compiled with 6.5.20240427)
libidn2: 2.3.7 (compiled with 2.3.7)
GPGME: 1.18.0
OpenSSL: OpenSSL 3.2.2-dev 
libnotmuch: 5.6.0
storage: tokyocabinet, kyotocabinet, qdbm, rocksdb, gdbm, bdb, tdb, lmdb
compression: lz4, zlib, zstd

Configure options: --bdb --gdbm --gpgme --kyotocabinet --lmdb --lua --lz4 --notmuch --pgp --rocksdb --qdbm --sasl --smime --ssl --tokyocabinet --tdb --zlib --zstd 

Compilation CFLAGS: -std=c11 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -I/usr/include/lua5.4 -I/usr/include -I/usr/include -DNCURSES_WIDECHAR -I/usr/include -I/include -I/usr/include/ -I/usr/include/qdbm -I/usr/include -I/usr/include -I/usr/include -O2

Compile options:
  -autocrypt +fcntl -flock -fmemopen +futimens +getaddrinfo -gnutls +gpgme 
  -gsasl -gss +hcache -homespool +idn +inotify -locales_hack +lua -mixmaster 
  +nls +notmuch +openssl +pgp +regex +sasl +smime -sqlite +truecolor 

MAILPATH="/var/mail"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"

Extra Info

  • Operating System and its version: Debian sid
  • Were you using multiple copies of NeoMutt at once? No
  • Were you using 'screen' or 'tmux'? No
  • Is your email local (maildir) or remote (IMAP)? local Maildir
@madduck madduck added the type:bug Bug label Jun 14, 2024
@gahr
Copy link
Member

gahr commented Jun 18, 2024

What's in your index_format? Does it happen with a minimal one such as %s?

@madduck
Copy link
Contributor Author

madduck commented Jun 18, 2024

What's in your index_format? Does it happen with a minimal one such as %s?

Exactly the same problem. I've also disabled all hooks.

For the record, this is what I have:

index-format-hook  date  "~d<1d"    "%{%H:%M%Z}"
index-format-hook  date  "~A"       "%d"
index_format="%4C %Z %-10@date@ %-15.15F %4c%?M?/[%M]? %?H?[%H] ?%s"

@gahr
Copy link
Member

gahr commented Jun 18, 2024

Can you run with -d10 and see if something happens in the logs? I think it would be in ~/.neomuttdebug0

@gahr
Copy link
Member

gahr commented Jun 18, 2024

Actually, it's not unreasonable to me that sorting / threading 419009 messages takes a couple of seconds. Does it go away if you set use_threads=flat?

@madduck
Copy link
Contributor Author

madduck commented Jun 19, 2024

No sizeable difference with flat threads. With debug output, I found that while it's delaying the folder load, it outputs these two lines presumably for every message in the folder, and there are about half a million in that folder where I feel the pain the most:

[2024-06-19 14:03:55]<2> maildir_move_to_mailbox() Considering·
[2024-06-19 14:03:55]<2> maildir_move_to_mailbox() Adding header structure. Flags: OR
[…]
[2024-06-19 14:04:01]<2> maildir_move_to_mailbox() Considering·
[2024-06-19 14:04:01]<2> maildir_move_to_mailbox() Adding header structure. Flags: OR
[2024-06-19 14:04:02]<M> mutt_sort_headers() Sorting mailbox...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants