Svg caching

When rendering complex shapes onto canvas β€” those consisting of thousands of paths β€” it’s usually faster to have them cached so that they get rendered with ctx.drawImage.
This essentially replaces thousands of low-level commands (lineTo, moveTo, bezierCurveTo, arcTo, etc.) with a single drawImage.

The downside is an higher memory usage since all svgs gets a canvas with a image copy of the svg.

Edit this page on Github