After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785718 - Optimize Maildir sync/check to not load whole summary
Optimize Maildir sync/check to not load whole summary
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
3.22.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2017-08-02 07:24 UTC by Paul Menzel
Modified: 2017-08-04 10:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Two backtrace after telling Evolution to quit `(gdb) t a a bt f` (122.07 KB, text/plain)
2017-08-02 07:24 UTC, Paul Menzel
Details
Four traces after telling Evolution to quit (without empty trash on exit) `(gdb) t a a bt f` (122.15 KB, text/plain)
2017-08-04 07:55 UTC, Paul Menzel
Details

Description Paul Menzel 2017-08-02 07:24:42 UTC
Created attachment 356762 [details]
Two backtrace after telling Evolution to quit `(gdb) t a a bt f`

Debian Sid/unstable with Evolution 3.22.6 is used. After bug #785212, I disabled all my virtual/search folders (vFolder). This improved Evolution’s “quitting time” quite a bit from several minutes to between 60 to 120 seconds.

Please find two backtrace from while Evolution is quitting attached.
Comment 1 Milan Crha 2017-08-03 12:10:20 UTC
Thanks for a bug report. If I read the backtraces properly, then you've configured to empty Trash on exit of evolution. It looks like that at least. The thing is that your On This Computer folders are opened one by one and it's checked whether there are any deleted message and those are eventually expunged. It does that in a very ineffective way, by loading the whole folder summary into memory.

Could you verify that it's about the Empty Trash on exit, please? It's in Edit->Preferences->Mail Preferences->General tab->Delete Mail section.
Comment 2 Paul Menzel 2017-08-04 07:55:05 UTC
Created attachment 356916 [details]
Four traces after telling Evolution to quit (without empty trash on exit) `(gdb) t a a bt f`

(In reply to Milan Crha from comment #1)
> Thanks for a bug report. If I read the backtraces properly, then you've
> configured to empty Trash on exit of evolution. It looks like that at least.
> The thing is that your On This Computer folders are opened one by one and
> it's checked whether there are any deleted message and those are eventually
> expunged. It does that in a very ineffective way, by loading the whole
> folder summary into memory.

I believe my folder summary files are quite big. Several hundred of megabytes.

> Could you verify that it's about the Empty Trash on exit, please? It's in
> Edit->Preferences->Mail Preferences->General tab->Delete Mail section.

Disabling the feature to empty the trash on exit of Evolution did not improve the situation. Please find the straces attached.
Comment 3 Milan Crha 2017-08-04 08:44:16 UTC
(In reply to Paul Menzel from comment #2)
> Disabling the feature to empty the trash on exit of Evolution did not
> improve the situation. Please find the straces attached.

Thanks. I see it still calls camel_store_synchronize_sync(), this time without requesting expunge, which corresponds with that option being off in Preferences. Let me try to figure out whether I can "optimize" maildir_summary_check() to not call camel_folder_summary_prepare_fetch_all() at all.
Comment 4 Milan Crha 2017-08-04 10:41:06 UTC
I managed to do changes to optimize Maildir's sync/check functions to work without loading the whole summary into memory, but the change is slightly controversial, thus I decided to commit it only to the development version. Any early testing is welcome, though it would work for 3.24.x and later only (due to changes in CamelMessageInfo).

Created commit d71b025 in eds master (3.25.90+)