Bug 11245 - (int-182136) Modest is extremely slow at loading external images
(int-182136)
: Modest is extremely slow at loading external images
Status: NEW
Product: Email
General
: 5.0:(10.2010.19-1)
: N900 Maemo
: Unspecified major with 8 votes (vote)
: ---
Assigned To: unassigned
: modest-bugs
:
: performance
:
:
  Show dependency tree
 
Reported: 2010-09-03 19:49 UTC by Nick Cremelie
Modified: 2010-12-17 18:57 UTC (History)
3 users (show)

See Also:


Attachments
example of message causing the issue (46.84 KB, text/plain)
2010-09-07 10:16 UTC, Nick Cremelie
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Nick Cremelie (reporter) 2010-09-03 19:49:32 UTC
SOFTWARE VERSION:
(Settings > General > About product)
10.2010.19-1

EXACT STEPS LEADING TO PROBLEM: 
(Explain in detail what you do (e.g. tap on OK) and what you see (e.g. message
Connection Failed appears))
1. Open a message that contains links to external messages.
2. Click the "load images" icon in the bottom toolbar.

EXPECTED OUTCOME:
Images are downloaded and shown promptly.

ACTUAL OUTCOME:
The images are downloaded extremely slowly, even over a wifi connection. The
entire system slows down and scrolling through the message becomes very choppy
or downright impossible.

REPRODUCIBILITY:
(always, less than 1/10, 5/10, 9/10)
Always

EXTRA SOFTWARE INSTALLED:
None

OTHER COMMENTS:
You can watch images coming in line by line. If the message links to over 10
images, it can take several minutes until all images are downloaded. In some
cases, some images are simply skipped and not downloaded. During the action,
Modest consumes over 90% of CPU. With image-heavy messages, the entire system
can become temporarily unresponsive.
For comparison reasons and to exclude other factors like the network connection
or web server, I opened the same messages on a Nokia E71 with the Nokia
Messaging client, using the same wifi connection. On the E71, the images were
loaded within a second.


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; nl; rv:1.9.2.8)
Gecko/20100722 Firefox/3.6.8
Comment 1 Andre Klapper maemo.org 2010-09-06 16:10:05 UTC
Thanks for splitting this from bug 6279! (Note to myself: int-182136)
Comment 2 Eero Tamminen nokia 2010-09-06 16:37:26 UTC
> For comparison reasons and to exclude other factors like the network connection
> or web server, I opened the same messages on a Nokia E71 with the Nokia
> Messaging client, using the same wifi connection. On the E71, the images were
> loaded within a second.

In which format these images were?  Jpeg?

Jpeg format & library support loading smaller versions of the image without
needing to process all of data (1/2, 1/4, 1/8) and it can contain thumbnails:
  http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format

I've never used E71, but E71 resolution seems to be 320 x 240, 1/5th of N900
resolution.  Because of this, it probably loads the images in much smaller
resolution or maybe even just the thumbnail version of it (if the jpeg file
contains thumbnail).  With N900 resolution & DPI, the thumbnails embedded into
the image itself wouldn't be large enough I think.
Comment 3 Nick Cremelie (reporter) 2010-09-06 17:05:33 UTC
(In reply to comment #2)
> > For comparison reasons and to exclude other factors like the network connection
> > or web server, I opened the same messages on a Nokia E71 with the Nokia
> > Messaging client, using the same wifi connection. On the E71, the images were
> > loaded within a second.
> 
> In which format these images were?  Jpeg?
> 
> Jpeg format & library support loading smaller versions of the image without
> needing to process all of data (1/2, 1/4, 1/8) and it can contain thumbnails:
>   http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format
> 
> I've never used E71, but E71 resolution seems to be 320 x 240, 1/5th of N900
> resolution.  Because of this, it probably loads the images in much smaller
> resolution or maybe even just the thumbnail version of it (if the jpeg file
> contains thumbnail).  With N900 resolution & DPI, the thumbnails embedded into
> the image itself wouldn't be large enough I think.
> 

I verified several messages that seem problematic and it's usually a mixture of
jpg and gif images.

I'm not convinced that the slow download is entirely due to the fact that the
N900 is loading the image in full resolution. In fact, I have compared the N900
and the E71 with a message containing images that are 788x544 pixels. On the
E71 with its lower resolution, I need to pan to see the entire image. This
indicates though that the E71 has also loaded the full image in this case, and
it has done so much much faster than the N900. On the N900, I need to click the
"load images" icon several times as after the first click, only part of the
images are loaded and then it seems to give up. For further verification I
opened the same set of message on a Nokia 5800 and on a smartphone of a
different (fruity) brand, and both load the images way way faster than the
N900. Modest on the N900 is definitely loading multiple images in a very
inefficient way. Note also that seems clearly an issue with modest, not the
N900 core system: if I open the same messages in the N900 browser through
Gmail's full web interface, the images are loaded promptly.
Comment 4 Eero Tamminen nokia 2010-09-07 09:59:58 UTC
> I'm not convinced that the slow download is entirely due to the fact that the
> N900 is loading the image in full resolution. In fact, I have compared the N900
> and the E71 with a message containing images that are 788x544 pixels.

Oh, they were that small.  In that case it indeed seems very suspicious...
Comment 5 Eero Tamminen nokia 2010-09-07 10:02:53 UTC
Btw. are the GIFs animated?  And if yes, does Modest (visibly) animate them?
Comment 6 Nick Cremelie (reporter) 2010-09-07 10:16:50 UTC
Created an attachment (id=3070) [details]
example of message causing the issue

The attached mail message is quite picture heavy and shows the reported issue
very well.
Comment 7 Nick Cremelie (reporter) 2010-09-07 10:19:12 UTC
(In reply to comment #5)
> Btw. are the GIFs animated?  And if yes, does Modest (visibly) animate them?
> 

The GIFs in the problematic messages are not animated. Most of the pictures in
the messages are jpg. Only a few small layout elements like solid bars are GIFs
in these particular messages.

I have attached an example message that shows the reported issue very well on
my N900. Let me know if it would be helpful to forward the message directly to
your mail address.
Comment 8 Eero Tamminen nokia 2010-09-07 10:31:19 UTC
(In reply to comment #7)
> Let me know if it would be helpful to forward the message directly to your mail address.

Wouldn't help as I'm not involved with Modest development.  Modest maintainer
needs to take the ball here.
Comment 9 Nick Cremelie (reporter) 2010-09-07 15:56:11 UTC
Further analysis:
- Even in a message referring to just one external 100KB 600x400 jpg, the image
is loaded relatively slowly (several seconds) compared to email clients on
other (Nokia and other brands) phones. The system remains responsive in this
case.
- After a look at the modest code, my wild guess is that either the
tny_vfs_stream_xyz functions are inefficient/causing huge overhead; or the
on_fetch_image_xyz_refresh_view functions are being activated too often or
causing images to be reloaded from the beginning; or too many threads(
on_fetch_image_thread) are being created causing the images to be fetched
multiple times.
Comment 10 Andy Dunmore 2010-09-08 08:35:02 UTC
*** This bug has been confirmed by popular vote. ***
Comment 11 William 2010-09-13 11:09:13 UTC
Thanks for opening this bug. I can confirm Modest has been like this since
PR1.0.
Comment 12 Paul Hartman 2010-12-17 18:57:32 UTC
It seems that progressive JPEG images (the kind that start off blurry and get
clearer as it loads) are very slow to display compared to non-progressive.