<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add support for ColorSpaces and deep color to Color.h"
   href="https://bugs.webkit.org/show_bug.cgi?id=160520#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add support for ColorSpaces and deep color to Color.h"
   href="https://bugs.webkit.org/show_bug.cgi?id=160520">bug 160520</a>
              from <span class="vcard"><a class="email" href="mailto:dino&#64;apple.com" title="Dean Jackson &lt;dino&#64;apple.com&gt;"> <span class="fn">Dean Jackson</span></a>
</span></b>
        <pre>8/2/16, 4:17 PM Dean Jackson:
Doing some allocation tracking it seems an average page (macrumors daringfireball) has on the order of 3000 - 6000 colors.

8/2/16, 4:19 PM Dean Jackson:
Lea's amazing <a href="http://leaverou.github.io/conic-gradient/">http://leaverou.github.io/conic-gradient/</a> got to about 8200 live color instances.

8/2/16, 4:25 PM Dean Jackson:
Although, that number would probably be smaller if we implemented conic-gradient :)

The single page HTML5 got to about 300,000 colors at its highest point, so an extra 64bit pointer would be about 2.25 Mb of extra memory (double what the current Color is).

8/3/16, 11:14 AM Dean Jackson:
If we start counting unique colors....

daringfireball.net 22
html5 spec 106 (out of 350k creations)
macrumors 76
apple.com/iphone 26
BBC 68
etc

8/3/16, 1:18 PM Dean Jackson:
With discussion from Sam:

Current 
   - 64 bits 
       (32 for inline color, 1 bit for validity)
   - Inline access

Double Size
   - 128 bits 
       (32 for inline color, 1 bit for validity, 64 bits for pointer to extended data)
   - Direct access

   Con: 
       - Double the size
           ~2MB extra on HTML spec test

Atomic Color (the color of tomorrow)
   - 64 bits
       (64 bits for pointer to uniqued color)
   - Indirect access

   Con: 
       - Indirect access might be a perf hit

Tagged pointer
   - 64 bits
       (same as current, except you have a bit which tells you if this is a pointer to the extended data)
   - Direct access after branch

   Con: 
       - Adds a branch to all color access
       - Might not work with current tools

8/3/16, 1:18 PM Dean Jackson:</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>