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 743926 - Slow to render large plain text emails
Slow to render large plain text emails
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
3.12.x (obsolete)
Other Linux
: High major
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
: 720928 733543 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-02-03 12:01 UTC by Pacho Ramos
Modified: 2015-04-21 08:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace (20.21 KB, text/plain)
2015-02-03 12:01 UTC, Pacho Ramos
Details
mail.bz2 (210.50 KB, application/octet-stream)
2015-02-03 12:42 UTC, Pacho Ramos
Details

Description Pacho Ramos 2015-02-03 12:01:41 UTC
Created attachment 296010 [details]
backtrace

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[New LWP 30015]
[New LWP 20819]
[New LWP 20578]
[New LWP 20395]
[New LWP 20394]
[New LWP 20393]
[New LWP 20392]
[New LWP 20386]
[New LWP 20385]
[New LWP 20384]
[New LWP 20291]
[New LWP 20283]
[New LWP 20246]
[New LWP 20245]
[New LWP 20244]
[New LWP 20243]
[New LWP 20242]
[New LWP 20241]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
WebCore::Style::attachRenderTree (current=..., resolvedStyle=...) at ./Source/WebCore/dom/ShadowRoot.h:125
125	./Source/WebCore/dom/ShadowRoot.h: No existe el fichero o el directorio.

Thread 1 (Thread 0x7f806f50d940 (LWP 20238))

  • #0 WebCore::Style::attachRenderTree
    at ./Source/WebCore/dom/ShadowRoot.h line 125
  • #1 WebCore::Style::attachChildren
    at Source/WebCore/style/StyleResolveTree.cpp line 463
  • #2 WebCore::Style::attachRenderTree
    at Source/WebCore/style/StyleResolveTree.cpp line 554
  • #3 WebCore::Style::attachChildren
    at Source/WebCore/style/StyleResolveTree.cpp line 463
  • #4 WebCore::Style::attachRenderTree
    at Source/WebCore/style/StyleResolveTree.cpp line 554
  • #5 WebCore::Style::attachChildren
    at Source/WebCore/style/StyleResolveTree.cpp line 463
  • #6 WebCore::Style::attachRenderTree
    at Source/WebCore/style/StyleResolveTree.cpp line 554
  • #7 resolveLocal
    at Source/WebCore/style/StyleResolveTree.cpp line 678
  • #8 WebCore::Style::resolveTree
    at Source/WebCore/style/StyleResolveTree.cpp line 832
  • #9 WebCore::Style::resolveTree
    at Source/WebCore/style/StyleResolveTree.cpp line 906
  • #10 WebCore::Document::recalcStyle
    at Source/WebCore/dom/Document.cpp line 1752
  • #11 WebCore::Document::updateStyleIfNeeded
    at Source/WebCore/dom/Document.cpp line 1802
  • #12 WebCore::Document::finishedParsing
    at Source/WebCore/dom/Document.cpp line 4457
  • #13 WebCore::HTMLConstructionSite::finishedParsing
    at Source/WebCore/html/parser/HTMLConstructionSite.cpp line 392
  • #14 WebCore::HTMLTreeBuilder::finished
    at Source/WebCore/html/parser/HTMLTreeBuilder.cpp line 3025
  • #15 WebCore::HTMLDocumentParser::end
    at Source/WebCore/html/parser/HTMLDocumentParser.cpp line 439
  • #16 WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd
    at Source/WebCore/html/parser/HTMLDocumentParser.cpp line 450
  • #17 WebCore::HTMLDocumentParser::prepareToStopParsing
    at Source/WebCore/html/parser/HTMLDocumentParser.cpp line 165
  • #18 WebCore::HTMLDocumentParser::finish
    at Source/WebCore/html/parser/HTMLDocumentParser.cpp line 490
  • #19 WebCore::DocumentWriter::end
    at Source/WebCore/loader/DocumentWriter.cpp line 248
  • #20 WebCore::DocumentLoader::finishedLoading
    at Source/WebCore/loader/DocumentLoader.cpp line 440
  • #21 WebCore::CachedResource::checkNotify
    at Source/WebCore/loader/cache/CachedResource.cpp line 332
  • #22 WebCore::CachedRawResource::finishLoading
    at Source/WebCore/loader/cache/CachedRawResource.cpp line 94
  • #23 WebCore::SubresourceLoader::didFinishLoading
    at Source/WebCore/loader/SubresourceLoader.cpp line 309
  • #24 WebCore::readCallback
    at Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp line 1339
  • #25 async_ready_callback_wrapper
    at /var/tmp/portage/dev-libs/glib-2.42.1/work/glib-2.42.1/gio/ginputstream.c line 523
  • #26 g_task_return_now
    at /var/tmp/portage/dev-libs/glib-2.42.1/work/glib-2.42.1/gio/gtask.c line 1077
  • #27 complete_in_idle_cb
    at /var/tmp/portage/dev-libs/glib-2.42.1/work/glib-2.42.1/gio/gtask.c line 1086
  • #28 g_main_dispatch
    at /var/tmp/portage/dev-libs/glib-2.42.1/work/glib-2.42.1/glib/gmain.c line 3111
  • #29 g_main_context_dispatch
    at /var/tmp/portage/dev-libs/glib-2.42.1/work/glib-2.42.1/glib/gmain.c line 3710
  • #30 g_main_context_iterate
    at /var/tmp/portage/dev-libs/glib-2.42.1/work/glib-2.42.1/glib/gmain.c line 3781
  • #31 g_main_loop_run
    at /var/tmp/portage/dev-libs/glib-2.42.1/work/glib-2.42.1/glib/gmain.c line 3975
  • #32 gtk_main
    at /var/tmp/portage/x11-libs/gtk+-3.14.7/work/gtk+-3.14.7/gtk/gtkmain.c line 1207
  • #33 main
    at main.c line 685

Comment 1 Pacho Ramos 2015-02-03 12:05:56 UTC
I think I have found the mail that causes this... but I cannot find its file under .local/share/evolution dirs :S
Comment 2 Pacho Ramos 2015-02-03 12:42:14 UTC
Created attachment 296013 [details]
mail.bz2

I think it's one of this really big mails
Comment 3 Milan Crha 2015-02-10 16:47:46 UTC
Thanks for a bug report. I see it too, but that's due to the message size. If I let webkit work long enough (about 10-30 seconds) then it renders fine finally. I do not think it's doable for Evolution to fix this in any way, but it would be nic to know an option from Tomas, whom knows webkit better (the thing I think of is what if evolution has set some callbacks on webkit which are triggered often during such long messages render phase).

Tomas?
Comment 4 Pacho Ramos 2015-02-10 20:56:50 UTC
But, in my case, it takes several minutes (well, next time I will leave it running to see if finally it gets shown ;)
Comment 5 Milan Crha 2015-02-11 11:35:56 UTC
The response time may depend on the machine speed, thus it's possible it takes longer on slower machines. I just re-tried and it took 1 minute and 22 seconds to show the message (my previous subjective measure with "10-30 seconds" was obviously wrong).
Comment 6 Milan Crha 2015-02-18 12:47:31 UTC
I stepped around a similar mail and dive a bit into the investigation about the slowness. It took me to two places:
a) CamelMimeFilterToHTML is causing one part of the slowness, when converting
   plain text emails into HTML code
b) evolution has a workaround for webkit's bug:
   https://bugs.webkit.org/show_bug.cgi?id=89553
   it's done in a way of zooming in and out (or out and in) the view, which
   causes render of the message two more times. That means that the message
   is rendered 3 times, before it's finally shown to a user.

While there cannot be done much with the b), maybe except of moving to webkit2 or fix the issue in webkit or find another workaround to make frame-flattening work, then there is probably a room to improve the a). I guess so at least.
Comment 7 Milan Crha 2015-03-05 13:03:00 UTC
*** Bug 733543 has been marked as a duplicate of this bug. ***
Comment 8 Milan Crha 2015-03-10 07:26:10 UTC
*** Bug 733877 has been marked as a duplicate of this bug. ***
Comment 9 Steve Holland 2015-03-10 14:33:16 UTC
The feel of how rapidly this goes from inconsequential to impossibly slow
gives me the impression that there is some algorithm hiding underneath that is 
O(n^2) or O(n^3) that should be O(n)...

Making Text/CSV/etc.  attachments not always display inline by default might help address some of these problems until they underlying bug is fixed. 

For example, per this suggestion: https://mail.gnome.org/archives/evolution-list/2015-February/msg00061.html
Comment 10 Milan Crha 2015-03-31 15:16:40 UTC
*** Bug 720928 has been marked as a duplicate of this bug. ***
Comment 11 Milan Crha 2015-04-17 12:30:42 UTC
I spent half of the day on this and I was able to reproduce the slowness in a pure WebKitWebView too, from which I'd say the problem lies on both ends. The tests showed that webkit2 (currently not used by the Evolution) 2.8.1 behaves significantly better than 2.6.5 (see [1] for more information).

While I'm not able to influence WebKit code, I can at least change the workaround evolution has, which I mentioned in the comment #6. I made a change to do one of the zooming with a minimal content in the view, thus it's lightning fast, while the second zoom call is done with the filled content. As it's only one zoom call, not two, the time spent on the zooming is half after the change. I'm closing this bug with this change in evolution. The rest should be done by the port to use webkit2 and in the webkit code itself.

A side note, the CamelMimeFilterToHTML is working with whole lines. It means when the body of the message is one long line, then it searches in the same line multiple times (the content is read in 4KB chunks). Thus there is a little room for improvements as well, but as the usual messages are also line-based, then I'll keep it that way for now.

Created commit 772bc9c in evo master (3.17.1+)
Created commit 8e54b0e in evo gnome-3-16 (3.16.2+)

[1] https://bugs.webkit.org/show_bug.cgi?id=143868
Comment 12 Stephen 2015-04-17 13:51:04 UTC
Bug 733877 (https://bugzilla.gnome.org/show_bug.cgi?id=733877 - freezing on CSV attachments) was closed as a duplicate of this bug, but when there is an attached CSV, Evolution should not attempt to parse the CSV at all when just selecting the message.

I'm assuming that as of comment #11 an attached CSV will still be parsed in this case?

If so, should that bug be re-opened or this one?
Comment 13 Milan Crha 2015-04-20 10:08:02 UTC
(In reply to Stephen from comment #12)
> when there is an attached CSV, Evolution should not attempt to parse
> the CSV at all when just selecting the message.

Thanks for the reminder, I overlooked it. There is a plan to avoid attachments "pre-parsing" together with the port of Evolution to use WebKit2.

Tomas, do we have a bug report for it already, or you'd prefer to reopen Stephen's bug report?
Comment 14 Milan Crha 2015-04-21 06:42:08 UTC
(In reply to Milan Crha from comment #13)
> Tomas, do we have a bug report for it already, or you'd prefer to reopen
> Stephen's bug report?

Tomas told me there is no bug opened for it yet, thus I'm reopening Stephen's.