[Webkit-unassigned] [Bug 175890] New: Image data should be coalesced if it comes in small chunks before updating the ImageSource
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Aug 23 10:40:23 PDT 2017
https://bugs.webkit.org/show_bug.cgi?id=175890
Bug ID: 175890
Summary: Image data should be coalesced if it comes in small
chunks before updating the ImageSource
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Images
Assignee: webkit-unassigned at lists.webkit.org
Reporter: sabouhallawa at apple.com
1. Open https://www.nasa.gov/sites/default/files/thumbnails/image/pia21778.png
Results: On fast machine and fast network, the page finishes loading after seven seconds. On a slow network, the page can finish loading after five minutes.
NOTE: The size of this image is 45MB. When loading it, the server sends it in a small chunks, each chunk is less than 1MB. The networking process receives all the data within normal duration. For example on a fast network, the whole image data is received in less than a second. The problem is having to repeat the following steps with each chunk of data:
-- The new data chunk is added to a SharedBuffer.
-- CachedImage sets its BitmapImage with the new data which asks the SharedBuffer to create a CFData. Creating a CFData requires all the segments of the SharedBuffer to be combined in one single buffer.
-- BitmapImage sets the new data to its ImageSource which passes it to its ImageDecoder.
-- CachedImage notifies its clients that new data chunk has arrived. The image renderer, which is one of the CachedImage's clients, will repaint itself. This will cause the image to be drawn which will request the ImageDecoder to decode the image frame.
It turns out running theses steps is extremely expensive if they have to be repeated many times because a large image receives its data in small chunks. The solution can be coalescing the number of updates based on time, i.e. updating the ImageSource only after certain period of time. This period of time increases as long as the images has not finished loading.
This strategy has been working for iOS; see ImageSource::dataChanged(). We need to enable this strategy for all platforms. In the current iOS solution, ImageSource coalesces how many times it updates the ImageDecoder with the new data. But CachedImage still causes the image renderer to repaint itself even though the Image itself does not change. We need to fix this for all platforms including iOS.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170823/3f126fe0/attachment.html>
More information about the webkit-unassigned
mailing list