SVG vs. Canvas

Well, SVG doesn’t scale well to large numbers of objects, but Canvas doesn’t scale well to large screens:

Performance with many objects

Here are the results of the first fruitful experiment, which clearly shows that SVG performance degrades quickly (exponentially on Safari?) in the number of objects, but Canvas performance remains at a near-constant low. This makes sense, since Canvas is just a bitmap buffer, while SVG has to maintain additional references to each object that it renders. Also, though not pictured, note that performance in clearing an SVG element also decreases in the number of drawn objects.

Performance on a large rendering context

Via Boris Smus

Tags: ,

2 Responses to “SVG vs. Canvas”

  1. Unterbahn » Blog Archive » Comparison of SVG and Canvas in OpenLayers Says:

    [...] of course, it bears mentioning this earlier comparison I dug up some months ago, which focuses on SVG/Canvas different sized rendering areas and different [...]

  2. SVG map sample and Canavas in OpenLayers « Geospatial Haiku Says:

    [...] SVG vs Canvas comparison by Jeffrey Warren from : http://unterbahn.com/2009/08/svg-vs/ [...]

Leave a Reply