Bug 158281 - SVGImage should report a more accurate memory cost for its decoded data
Summary: SVGImage should report a more accurate memory cost for its decoded data
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2016-06-01 16:03 PDT by Said Abou-Hallawa
Modified: 2016-06-02 08:01 PDT (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2016-06-01 16:03:39 PDT
In http://trac.webkit.org/changeset/201334, a simple calculation for the SVGImage memory cost was implemented. A more accurate but fast solution is required for better memory and resource caching utilization. Two solutions should be investigated:

1. A through navigation for the DOM and the render trees of the SVGImage accounting all the big memory chunks especially the vectors and the expensive cached graphics resources, e.g. the Path object. The down side of this approach is it is very costly and it's likely to become stale over time. 

2. Assume the SVGImage decoded data (the DOM and the render trees) is a ratio of the encoded data. This would require some heuristic to get this ratio offline. The ratio can be applied on the SVGImage level itself; e.g. sizeof_decoded_SVGImage = sizeof_encoded_SVGImage x decoding_ratio. Its down side is it is hard to get a good estimate for decoding_ratio. Also the result can be an inaccurate estimate especially if the SVG includes shared resources and they are referenced many times.
Comment 1 Radar WebKit Bug Importer 2016-06-01 16:10:30 PDT
Comment 2 Radar WebKit Bug Importer 2016-06-01 16:13:17 PDT