W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2010

Re: Replacing WebSQL with a Relational Data Model.

From: Jeremy Orlow <jorlow@chromium.org>
Date: Wed, 27 Oct 2010 14:34:46 +0100
Message-ID: <AANLkTikmimz7Uo6ud0J8SLYucOKnXw7adRmN6M2R7anP@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: Keean Schupke <keean@fry-it.com>, Nathan Kitchen <w3c@nathankitchen.com>, nathan@webr3.org, public-webapps@w3.org, Jonas Sicking <jonas@sicking.cc>, Arthur Barstow <art.barstow@nokia.com>
We're getting pretty far off topic here--even for this thread.


On Wed, Oct 27, 2010 at 2:22 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 10/27/10 7:12 AM, Keean Schupke wrote:
>> Actually the problem with this is the internal memory usage by the
>> browser to have a single page with 5000 divs in a list, each of which
>> has a layout with say 20 elements, so about 100,000 elements. The memory
>> used by the browser for the DOM tree
> In 64-bit Gecko (the numbers are smaller in a 32-bit build) a <div> is 56
> bytes.  So 100,000 of them (and using 20 elements for layout is a _lot_ of
> elements, btw) is 5.6MB of RAM used.
> Your typical low-end device nowadays has 64MB of RAM, right?  So if the
> above is all you're looking at you're more or less ok.  And again, if you're
> using 20 elements for layout then you're probably doing it wrong.
>  and rendering
> This is a much bigger problem, in my experience.  Gecko implements some XUL
> rendering classes that try to solve this problem by only creating rendering
> objects for the things that are visible in the viewport, subject to various
> limitations.  We've been thinking about ways to try to generalize this to
> web content...
>  is the problem, so I don't think (correct me if I am wrong) the
>> Flyweight pattern can help.
> Browsers use exactly that pattern already to reduce the memory used by DOM
> and rendering.  And the things we've been thinking about mentioned above
> also work similarly.
>  To get round this we only create enough divs to fill the screen, and
>> cycle them round by catching onscroll events. This is just about fast
>> enough - but was something I had to implement for our web developers as
>> a library due to the complexity.
> Right; the idea would be to move this sort of thing into the browser core.
> -Boris
Received on Wednesday, 27 October 2010 13:35:42 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:28 UTC