Re: [whatwg] Canvas-Only Document Type

Thank you for this information, Boris.  Did you collect this with
Firefox's own devtools?  I'd like to set up a full-view Canvas
document and see how it profiles.

FWIW, memory is one of several optimizations one could conjure, and it
is the culmination of these that (in concept) creates a more polished
experience.  For example, if a user changes their device orientation,
the application could perhaps respond in a more jank-free fashion
since the UA can skip refreshing the layout tree.



On Mon, Jul 7, 2014 at 9:47 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 7/7/14, 6:58 PM, Brian M. Blakely wrote:
>>
>> I am not a browser developer, I am a Web developer, but it stands to
>> reason that (as stated in the OP) there may at least be a fruitful memory
>> savings
>
>
> I just measured in Firefox 30, and a bare-bones document (about:blank) uses
> approximately 550KB of memory.
>
> This breaks down as about:
>
> * 330KB of JS heap (which presumably would be there anyway for your
>   special document),
> * 10KB DOM data structures
> * 210KB layout data (mostly style data, looks like).
>
> So you could plausibly save about 220KB of memory.  I encourage you to do
> similar measurements in other browsers as desired.
>
> For comparison, a 320x426 canvas (and I doubt you're going to be using ones
> smaller than that in this special mode) will have a backing store that takes
> about 545KB for a 2D canvas.  The sort of devices where you're likely to
> actually use WebGL will probably have 4MB+ canvas backing stores, and
> probably comparable for WebGL.
>
>
>
>> On the memory front, this could be especially useful when sharing space
>> with the 30+ tabs
>
>
> That would translate into a savings of about 7MB.  Not nothing, but just to
> put that in perspective simply loading
> http://code.jquery.com/jquery-1.11.1.min.js into those blank tabs above
> makes them use 1.43MB of memory instead of 550KB.  That's without _doing_
> anything; just loading the library.
>
> So I suspect in practice the script state and canvas backing stores in those
> 30+ tabs would totally swamp the 7MB of layout/DOM data.
>
> -Boris

Received on Tuesday, 8 July 2014 14:29:04 UTC