W3C home > Mailing lists > Public > public-canvas-api@w3.org > July to September 2011

Re: correct and incorrect uses of canvas

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 15 Jul 2011 11:21:28 -0700
Message-ID: <CA+c2ei_eVb4OhAPqgFY3anb+yqc691JcYhOkFW8KE29-akfvDA@mail.gmail.com>
To: Henri Sivonen <hsivonen@iki.fi>
Cc: Steve Faulkner <faulkner.steve@gmail.com>, HTMLWG WG <public-html@w3.org>, Frank Olivier <Frank.Olivier@microsoft.com>, Richard Schwerdtfeger <schwer@us.ibm.com>, Cynthia Shelly <cyns@microsoft.com>, David Singer <singer@apple.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, "Edward O'Connor" <hober0@gmail.com>, Canvas <public-canvas-api@w3.org>
On Fri, Jul 15, 2011 at 8:11 AM, Henri Sivonen <hsivonen@iki.fi> wrote:
> On Thu, 2011-07-14 at 13:40 -0700, Jonas Sicking wrote:
>> We can and should improve the
>> SVG DOM to attract more people, but I suspect there will always be a
>> group of people that choose to use canvas anyway due to better
>> performance or other reasons.
> Do you have examples of people choosing <canvas> over SVG for perf
> reasons? Are the perf reasons data-based or merely assumed? Are the perf
> reasons the kind of quality of implementation issues that can be
> considered to be transient and addressed over the next couple of years?
> In theory, SVG should be able to outperform <canvas> for painting,
> because the browser engine gets to control how often to repaint, what
> parts to repaint and can avoid intermediate bitmaps when the path
> stroking and filling can be performed nearer hardware and there are
> guaranteed not to be readbacks because the browser knows there aren't
> filters in use.

There's discussions at these two pages:


It doesn't contain numbers, but it sounds like they have measured. I'm
sure that if you ask you can get details.

> So in theory, if SVG has performance issues, they should be attributable
> to the DOM. If a sub-DOM is used for accessibility in the <canvas> case,
> then the <canvas> case has a DOM, too.

Rendering a über complicated checkbox could require hundreds of DOM
objects in the SVG DOM used to render it. But only a single DOM
element in the sub-DOM representing the <input type=checkbox>.

So I would expect severely different performance.

/ Jonas
Received on Friday, 15 July 2011 22:19:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:10:32 UTC