W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2014

Re: [whatwg] Canvas-Only Document Type

From: Brian Blakely <anewpage.media@gmail.com>
Date: Tue, 8 Jul 2014 10:28:17 -0400
Message-ID: <CAJGQg4GLqC0zsw3tZ-Mt5NuD+0hi7CS+eacdHQ7Sz402r_TRmQ@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "whatwg@lists.whatwg.org" <whatwg@lists.whatwg.org>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:21 UTC