Skip to main content

Reproducible engineering data

SVG optimization benchmark

This benchmark measures a fixed SVGO configuration against four checked-in SVG fixtures. It shows what happened to these inputs, explains how to reproduce the measurements, and avoids presenting a small fixture set as a universal savings promise.

The benchmark uses the same broad classes of cleanup exposed by FromSVG’s Optimize SVG workflow: path and group cleanup, comment and metadata removal, numeric precision of three decimals, ID cleanup, and color conversion. The benchmark is generated from source fixtures in the repository, not from user files.

Aggregate result for this fixture set

Fixtures

4

Raw source

2.40 KiB

Optimized

1.29 KiB

Gzip saved

31.43%

Across these four fixtures, raw source decreased by 46.34% and gzip output decreased by 31.43%. These figures describe this fixture set only.

Fixture-level measurements

FixtureRawOptimizedRaw savedRaw gzipOptimized gzip
editor-export.svg623 B218 B65.01%347 B158 B
illustration.svg641 B497 B22.46%368 B329 B
line-icon.svg413 B179 B56.66%236 B155 B
logo-mark.svg781 B425 B45.58%398 B283 B

Reproduce the benchmark

Clone the repository, install the existing dependencies, and run the checked-in command from the repository root:

npm run benchmark:svg

The command reads benchmarks/fixtures/*.svg, runs SVGO, computes UTF-8 and gzip sizes, records hashes, and rewrites benchmarks/svg-optimization.json. Review the generated diff whenever the fixtures, SVGO version, or configuration changes.

Configuration used

EngineSVGO ^4.0.1
PrecisionThree decimal places for path and numeric cleanup
CleanupIDs, groups, paths, comments, metadata, titles, descriptions, and colors
GzipNode zlib gzipSync at compression level 9

What this benchmark does not measure

Byte and gzip size do not measure visual similarity, browser parse time, render time, cache behavior, or the effect of an asset inside a larger bundle. An optimized SVG can also remove metadata that matters for accessibility or licensing. Keep the original source and inspect the output in the target browser and application. The benchmark’s fixture-level result should not be used as a guaranteed percentage for a different SVG corpus.

Continue with FromSVG