Performance Benchmarks

This page shows performance benchmarks comparing SVGN (our Rust implementation) against SVGO.

Last Updated: 2025-07-06 02:20 UTC

Test Configuration

Parameter Value
Test Files 2 SVG files (simple.svg, complex.svg)
Test Method Wall-clock timing
Test Directory testdata

Results Summary

Tool Version Total Time (s) Per File (ms) Success Rate Speedup
SVGN 1.5.8 0.141 70.5 100% 22.8x faster
SVGO (Bun) 4.0.0 3.210 1605 100% baseline

Key Findings

🚀 SVGN is 22.8x faster than SVGO when using Bun runtime

Per-file processing: SVGN averages 70.5ms vs SVGO’s 1605ms per file

Reliability: Both tools achieved 100% success rate

🏁 Startup time: SVGO has significant startup overhead (~3s) vs SVGN’s instant startup

Performance Comparison Chart

SVGN     ████ 0.141s (70.5ms per file)
SVGO     ████████████████████████████████████████████████████████████████████████████████████████████████████████ 3.210s (1605ms per file)

Detailed Results

Processing Times

SVGN: 0.141s total time

  • simple.svg: instant
  • complex.svg: instant
  • Total files: 2
  • Average per file: 70.5ms

SVGO: 3.210s total time

  • simple.svg: 4ms processing + startup overhead
  • complex.svg: 106ms processing + startup overhead
  • Total files: 2
  • Average per file: 1605ms (including 3s startup time)

Performance Analysis

  • Pure processing time: SVGO is competitive (4-106ms per file)
  • Startup overhead: SVGO has ~3s startup time, SVGN starts instantly
  • Overall performance: SVGN wins due to zero startup time

Test Methodology

  • Test Files: 2 representative SVG files (simple.svg, complex.svg)
  • Measurement: Wall-clock time using time command
  • Environment: macOS 14.5, Apple M2, 16GB RAM
  • SVGN: Native Rust binary (release build)
  • SVGO: JavaScript via Bun runtime (bunx --bun svgo)
  • Testing approach: Real-world usage simulation

File Size Analysis

Both tools achieved similar optimization results:

  • simple.svg: SVGN 0.0% reduction, SVGO 0.9% reduction
  • complex.svg: SVGN 0.0% reduction, SVGO 0.2% reduction

Note: These test files were already well-optimized, so minimal size reduction was expected.

Running Your Own Benchmarks

To generate fresh benchmark results:

# Build SVGN
cargo build --release

# Run comprehensive benchmarks
./scripts/benchmark-comprehensive.sh testdata 3 10 json true true

# Or run simple timing test
time ./target/release/svgn your_file.svg
time bunx --bun svgo your_file.svg

Compatibility

SVGN maintains full compatibility with SVGO:

  • Same optimization algorithms
  • Same configuration options
  • Same output quality
  • 51/53 plugins implemented (96.2% complete)

Want to try SVGN? Download the latest release or build from source.


Copyright © 2024 Adam Twardoch. Distributed under the MIT License.