3 ms·
Canvas is just a pixel buffer. Even with sufficient caching SVG would be slower because there’s more work to do with parsing, etc.
by klysm 3y ago
Canvas is just a pixel buffer. Even with sufficient caching SVG would be slower because there’s more work to do with parsing, etc.
- llm_nerd 3y agoCanvas is a pixel buffer...and a set of drawing rudiments to imperatively actually make that pixel buffer useful. If you were actually just using canvas as a pixel buffer it would be catastrophically slow. SVG is a pixel buffer and a set of drawing rudiments to imperatively or declaratively actually make that pixel buffer useful. The distinction you are drawing between these is sophistry.
- klysm 3y agoNo the distinction is important and directly related to performance. Supporting the canvas API requires fewer CPU instructions to get to pixels on the screen. The browser has to do a lot more work to turn SVG into pixels
- postalrat 3y agoSVG is a pixel buffer the same way html is a pixel buffer. It can have multiple types of animations, hover states, etc.