W3C home > Mailing lists > Public > www-svg@w3.org > July 2011

Re: Canvas in SVG, was: Re: minutes, SVG WG Seattle F2F 2011 day 1

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 29 Jul 2011 20:50:04 -0400
Message-ID: <4E33553C.3040504@mit.edu>
To: Alex Danilo <alex@abbra.com>
CC: www-svg@w3.org
On 7/29/11 7:38 PM, Alex Danilo wrote:
>> As proposed (using a replay buffer) this can very easily leak to
>> effectively leaking lots of memory for the page lifetime, and would for
>> most canvas uses I've seen, unless browsers implement complicated
>> heuristics to detect when they can drop things from the buffer because
>> the entire area covered by them has since been painted over with opaque
>> colors.
> Well change the default to 'discard', then it's just canvas in
> user units instead of those unscalable pixels.

I don't have a problem with the user units bit.

But my point was that having the non-'discard' value at all is problematic.

> I very much doubt any capable implementer would find managing
> the replay memory to be difficult or a source of leakage.

The proposal requires the UA to keep a log of all drawing commands made 
on the canvas, except the ones that can be proved to be completely 
hidden by later commands, no?

So the only way to keep memory from growing while a page keeps drawing 
to a canvas is either to find such completely-covered drawing commands 
and discard them or to have the page author manage the drawing command 
buffer memory themselves (e.g. by issuing clear commands every so 
often).  I can guarantee that web authors will not do a good job of this.

As for finding completely-covered drawing commands, this is possible, of 
course.  Might not be very fast, etc....

>> As an implementor I would be very wary of implementing this, assuming I
>> were willing to do it at all...
> Which implies you serve yourself and not your users...

My users are people who browse the web and do NOT want some random 
poorly coded page that they happen to leave running for 15 minutes in a 
background tab to eat up all their RAM and cause their computer to swap.

So it's in my users' interests for there to be fewer footguns in the web 

Now can we please drop the silly ad-hominem attacks?

Received on Saturday, 30 July 2011 00:50:33 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:25 UTC