10 Bad SVG Practices Silently Degrading Web Performance
From excessive decimal precision to unmerged path nodes and paint thrashing — the 10 subtle vector mistakes dragging down your Core Web Vitals.
Excessive Floating-Point Decimal Precision
Design tools export SVG path coordinates with 6 to 10 decimal places (e.g. d="M12.3847291 4.9182746..."). On a standard screen, 0.0001px is sub-atomic and completely invisible, but it bloats file sizes by 300% across thousands of icons.
floatPrecision: 2.
Unmerged Overlapping Vector Paths
An icon composed of 8 separate <path> and <circle> tags forces the browser's 2D vector rasterizer to calculate winding rules, fills, and anti-aliasing passes 8 separate times for a single 24px icon.
<path d="...">.
Embedding Base64 Raster Images in <image> Tags
Exporting a raster image inside an SVG wraps a massive 200 KB Base64 data URI string inside an XML tag. It offers none of SVG's vector scalability while destroying parse performance.
path, rect, circle). Never embed raster bitmaps.
Leaving Design Tool Metadata & Namespaces
Raw exports from Illustrator, Inkscape, or Figma contain huge blocks of useless XML comments, editor layers, guides, and namespaces (xmlns:sketch, sodipodi:namedview).
Duplicating Inline SVG Trees in Large Tables
Inlining a 30-line SVG icon across 500 rows in a data table adds 15,000 discrete DOM elements to the browser tree, degrading garbage collection and scroll FPS.
<svg><use href="/sprite.svg#icon-name" /></svg>.
Overusing Heavy SVG Filter Primitives (<feGaussianBlur>)
Complex SVG filter primitives like <feGaussianBlur> and <feDisplacementMap> bypass hardware GPU fast-paths, forcing continuous CPU software rasterization on scroll and hover.
filter: drop-shadow() or box-shadow instead of inline SVG filter graphs for standard drop shadows.
Animating Width & Height Instead of Transform
Triggering hover animations by changing SVG width or height attributes triggers expensive full-page layout reflows on every animation tick.
transform: scale() with hardware-accelerated composition.
Overusing vector-effect="non-scaling-stroke"
While useful for responsive strokes, applying vector-effect="non-scaling-stroke" across hundreds of dynamic nodes forces the graphics engine to recalculate matrix inverses on every resize.
Serving Uncompressed SVG Assets from CDNs
Because SVGs are plaintext XML, they achieve incredible 70–80% compression ratios under Brotli and Gzip. Forgetting to configure image/svg+xml compression on your CDN triples asset transfer times.
image/svg+xml in its active gzip/brotli compression rules.
Over-Nested <g> Group Wrappers
Figma layer exports frequently produce 5+ levels of nested <g id="Group 1"><g id="Frame 2">..., causing deep DOM traversal overhead with zero visual utility.