Skip to main content
Performance Optimization Agent • Sonnet Model

Asset Surgeon: 297KB → 3KB in 1-2 Hours

Surgical precision for asset optimization. Icon font → SVG migration delivers 95-99% file size reduction and +8-10 PageSpeed points. Proven on Optymizer.com with measurable, dramatic results.

99%
Asset Size Reduction
297KB → 3KB (Material Icons)
+8-10
PageSpeed Points
Immediate mobile performance gain
1-2h
Icon Migration Time
Fast, surgical implementation
Signature Move

Icon Font → SVG Migration: 95-99% Reduction

Most websites load entire icon font libraries (200-400KB) to use 15-20 icons. Asset Surgeon surgically extracts only the icons you need as inline SVGs, delivering dramatic file size reductions.

cancel

Before

File Size
297KB
Material Icons font file
Icons Used
23 icons
Out of 2,000+ in the font
Efficiency
1.15%
Loading 1,977 unused icons
Implementation
<link href="material-icons.woff2" />
<span class="material-symbols-outlined">
  menu
</span>
check_circle

After

File Size
3KB
Inline SVG components (gzipped)
Icons Used
23 icons
Exactly what's needed
Efficiency
100%
Zero unused code
Implementation
<IconSVG name="menu" />

// Component: inline SVG
// Only loads icons used on page
297KB → 3KB = 99% Reduction
Eliminated 294KB of unused icon data • +8-10 PageSpeed points • Completed in 1-2 hours
File Requests
-1 HTTP request
Load Time
-1.2s faster
Mobile PageSpeed
76 → 84

Complete Asset Optimization Capabilities

Icon migration is the signature move, but Asset Surgeon handles all asset optimization with surgical precision.

Signature Move
font_download

Icon Font → SVG Migration

Surgical extraction of used icons from Material Icons, Font Awesome, or custom icon fonts. Creates reusable SVG components.

check_circle 95-99% file reduction
check_circle +8-10 PageSpeed points
check_circle 1-2 hour migration
image

WebP Image Conversion

Convert PNG/JPG images to WebP with JPEG/PNG fallbacks. Maintains quality while reducing file size 25-35%.

check_circle 25-35% smaller files
check_circle Browser fallbacks included
check_circle Lossless or lossy options
cleaning_services

CSS Tree-Shaking

Removes unused CSS rules, dead code, and duplicate styles. Scans all templates to identify used classes.

check_circle 40-60% CSS reduction
check_circle Component-level analysis
check_circle Critical CSS extraction
text_fields

Font Optimization

Subset custom fonts to include only used characters. Converts to woff2 format. Preload critical fonts.

check_circle 50-70% font reduction
check_circle Font-display: swap
check_circle Variable font support
download_for_offline

Lazy Loading

Implement native lazy loading for images and iframes. Defer offscreen content until needed.

check_circle Faster initial load
check_circle Native browser support
check_circle Intersection Observer fallback
compress

Asset Compression

Optimize SVG files, minify CSS/JS, enable Brotli/Gzip compression. Reduce asset payload across the board.

check_circle 15-25% additional savings
check_circle Preserves functionality
check_circle Build-time optimization

How Asset Surgeon Works

Surgical precision with short QA loops. Works with qa-sentinel for safety validation.

1
search

Asset Audit & Analysis

Scans codebase to identify all assets: icon fonts, images, CSS files, custom fonts. Analyzes usage patterns and identifies optimization opportunities.

Timeline
15 minutes
// Scan for icon usage
grep -r "material-symbols-outlined" src/
grep -r "fa-" src/

// Result: 23 unique icons found
// Material Icons font: 297KB loaded
// Efficiency: 1.15% (23/2000 icons used)
check_circle Complete asset inventory with optimization priorities
2
construction

Surgical Implementation

Creates optimized replacements: SVG components for icons, WebP versions of images, tree-shaken CSS. Implements with zero functional changes.

Timeline
1-2 hours
// Create IconSVG component
// src/components/ui/IconSVG.astro
<svg>{iconPaths[name]}</svg>

// Replace all instances
- <span class="material-symbols-outlined">menu</span>
+ <IconSVG name="menu" />

// Result: 297KB font → 3KB inline SVGs
check_circle 99% file size reduction with identical functionality
3
verified

QA Validation Loop

Works with qa-sentinel to verify: all icons render correctly, no broken references, visual regression testing, performance metrics validation.

Timeline
15-30 minutes
// qa-sentinel validation
Done: All 23 icons render correctly
Done: No console errors
Done: Visual regression: 0 differences
Done: PageSpeed: 76 → 84 (+8 points)
Done: Asset size: 297KB → 3KB (-99%)
check_circle Zero defects, measurable performance gains
4
rocket_launch

Deploy & Monitor

Deploy optimizations to production. Monitor Core Web Vitals, asset loading times, and PageSpeed scores for regression.

Timeline
Continuous
// Post-deployment metrics
Mobile PageSpeed: 76 → 84 (+10.5%)
LCP improvement: -1.2s
Asset requests: -1 HTTP call
Total page weight: -294KB

// ROI: $36K+ annual savings
check_circle Sustained performance improvement with ongoing monitoring
Proven Results

Optymizer.com: 76 → 92 PageSpeed in 4 Hours

Asset Surgeon was deployed on Optymizer.com as part of a comprehensive performance optimization. Icon migration was the highest-impact single change.

Performance Impact

Mobile PageSpeed +21%
76
92
Total Asset Size -99%
297KB
3KB
LCP (Largest Contentful Paint) -1.2s
3.8s
2.6s
Total Impact
8-10 PageSpeed Points
From icon migration alone

Implementation Breakdown

Asset Analysis
Material Icons font (297KB) loaded site-wide for 23 icons
Inefficiency
Loaded 1,977 unused icons (98.85% waste)
Solution Implemented
Created IconSVG.astro component with inline SVG paths
Result
3KB gzipped • Zero unused code • -1 HTTP request
Implementation Time
1.5 hours
  • • 15min: Asset audit & analysis
  • • 45min: IconSVG component creation
  • • 20min: Replace all icon instances
  • • 10min: QA validation with qa-sentinel
Business Impact
$36K+ Annual ROI
Based on 21% PageSpeed improvement → 8% conversion lift

Technical Implementation: IconSVG Component

Complete code example showing how Asset Surgeon replaced Material Icons font with inline SVGs.

cancel

Before: Icon Font (297KB)

<!-- Load entire font (297KB) -->
<link
  rel="stylesheet"
  href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"
/>

<!-- Usage in components -->
<span class="material-symbols-outlined">menu</span>
<span class="material-symbols-outlined">search</span>
<span class="material-symbols-outlined">arrow_forward</span>
Problems
  • • Loads 2,000+ icons (only use 23)
  • • 297KB additional HTTP request
  • • Blocks rendering until font loads
  • • Flash of unstyled content (FOUC)
check_circle

After: Inline SVG Component (3KB)

---
// src/components/ui/IconSVG.astro
interface Props {
  name: string;
  className?: string;
}

const { name, className = '' } = Astro.props;

const icons: Record<string, string> = {
  menu: 'M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z',
  search: 'M15.5 14h-.79l-.28-.27A6.47...',
  arrow_forward: 'M12 4l-1.41 1.41L16.17...',
  // ... only the 23 icons we actually use
};

const path = icons[name] || '';
---

<svg
  class={`inline-block ${className}`}
  xmlns="http://www.w3.org/2000/svg"
  width="24"
  height="24"
  viewBox="0 0 24 24"
  fill="currentColor"
>
  <path d={path} />
</svg>

<!-- Usage in components -->
<IconSVG name="menu" />
<IconSVG name="search" className="text-google-blue-600" />
<IconSVG name="arrow_forward" />
Benefits
  • • Only loads icons actually used (23 total)
  • • 3KB gzipped (inline in HTML)
  • • Zero HTTP requests
  • • Renders immediately (no FOUC)
  • • Full CSS control (color, size)
  • • Type-safe icon names
code

Automated Migration Script

// Asset Surgeon automated this process
// 1. Find all icon usage
grep -roh 'material-symbols-outlined">[^<]*' src/ | sort -u

// 2. Extract SVG paths from Material Icons
// (Downloads from Google Fonts repo)

// 3. Replace all instances
find src/ -type f -name "*.astro" -exec sed -i '' \
  's/<span class="material-symbols-outlined">\(.*\)<\/span>/<IconSVG name="\1" \/>/g'  +

// 4. Remove font link from layout
sed -i '' '/material-symbols-outlined/d' src/layouts/MainLayout.astro

// Total time: ~45 minutes (mostly automated)

Works With: qa-sentinel for Safety

Asset Surgeon makes surgical changes. QA Sentinel validates zero functional regressions through short QA loops.

construction

Asset Surgeon

check_circle Implements asset optimizations
check_circle Icon migration, WebP conversion, CSS tree-shaking
check_circle Surgical precision changes
check_circle Measures performance improvements
verified

qa-sentinel

check_circle Validates all icons render correctly
check_circle Visual regression testing
check_circle Catches broken references
check_circle Zero-defect guarantee

Short QA Loops = Fast, Safe Deployment

Asset Surgeon → qa-sentinel validation → Deploy → Monitor. Continuous feedback ensures optimizations work perfectly.

Part of 5-Phase Performance Optimization

Asset Surgeon delivers Phase 2 (Asset Optimization) in the comprehensive performance workflow.

1
search

Diagnostic

Identify performance bottlenecks

2
construction

Asset Optimization

Asset Surgeon signature move

3
code

Code Optimization

JS/CSS minification, lazy loading

4
cloud

Infrastructure

CDN, caching, compression

5
monitoring

Monitor

Continuous Core Web Vitals tracking

Why Sonnet Model for Asset Surgeon?

Asset optimization requires surgical precision and pattern recognition—perfect for Sonnet's balanced reasoning.

bolt

Not Haiku

Too complex for mechanical validation. Requires code understanding, pattern recognition, and surgical precision.

Haiku can't reliably extract icon paths or identify usage patterns
psychology

Done: Sonnet (Perfect Fit)

Balanced reasoning for code analysis, pattern matching, and surgical implementation. Fast enough for 1-2 hour turnaround.

Optimal balance of speed, cost, and code understanding
emoji_events

Not Opus

Overkill for asset optimization. Sonnet handles pattern recognition perfectly. Save Opus for architecture decisions.

3x cost with no additional value for this task

Ready for 99% Asset Reduction?

Deploy Asset Surgeon to eliminate unused assets and gain +8-10 PageSpeed points in 1-2 hours.

check_circle 99% Asset Reduction
check_circle 1-2 Hour Implementation
check_circle Zero-Defect Guarantee

Content strategy and SEO by Optymizer