<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - SVGImage should report a more accurate more cost for its decoded data"
   href="https://bugs.webkit.org/show_bug.cgi?id=158281">158281</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SVGImage should report a more accurate more cost for its decoded data
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>SVG
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sabouhallawa&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>zimmermann&#64;kde.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In <a href="http://trac.webkit.org/changeset/201334">http://trac.webkit.org/changeset/201334</a>, 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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>