Fabric.js demos · 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 loss of quality when scaling the shape up (since it's no longer vector-based). But this is a viable technique if the shape dimensions are constant. In Fabric, you can use fabric.Object#cloneAsImage to create an instance of fabric.Image out of any other Fabric shape.