Experiment: 5276e75
rad experiment show 5276e753afc2cdc715d7dc8c9ac574358efcc4cf
by ee@did:key:z6MkvsiybCuk1WDZhh2aXDx7NTiZejKgWZygMNsUuXDMNvVQ · Apr 11 22:54 2026
snippet-dedupe svg icon 8x
Measurements
MetricBaselineThe benchmark measurement of the unmodified codeCandidateThe code with the proposed optimization appliedDeltaThe performance change from baseline to candidate
gzipped_client_bytes (bytes) primary53748.000 bytes (n=1)53717.000 bytes (n=1)-0.05%
raw_client_bytes (bytes) secondary163185.000 bytes (n=1)162050.000 bytes (n=1)-0.69%
Annotations
hypothesisextract the repeated 16x16 square svg icon into a {#snippet} — 8 copies in +page.svelte, ~180 bytes each, gzip should collapse repetition but snippet also shrinks raw
what_workedraw dropped 1135 bytes, gzipped dropped 31 bytes — a small but deterministic win
Base CommitThe starting commit before the optimization was appliedb57601c0b0bd906cabe4daa48e2d383d5b2dad2b
Candidate CommitThe code with the proposed optimization applied3c6212c633b5aae60836459a761d9ee1fd0aa283
Configoptimize.yaml
Diff
~ src/routes/+page.svelte
@@ -20,6 +20,10 @@
20 } 21 </script> 22 23+{#snippet squareIcon()} 24+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3.5V12.5H3.5V3.5H12.5Z" stroke="currentColor"/></svg> 25+{/snippet} 26+ 27 <div class="min-h-screen bg-surface-canvas p-12"> 28 <div class="max-w-4xl mx-auto space-y-8"> 29 <!-- Header with theme controls -->
@@ -86,35 +90,35 @@
90 </div> 91 <div class="flex flex-wrap gap-3 items-center"> 92 <Button> 89- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3.5V12.5H3.5V3.5H12.5Z" stroke="currentColor"/></svg> 93+ {@render squareIcon()} 94 With Icon 95 </Button> 96 <Button>Without Icon</Button> 97 <Button size="icon"> 94- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3.5V12.5H3.5V3.5H12.5Z" stroke="currentColor"/></svg> 98+ {@render squareIcon()} 99 </Button> 100 <Button size="icon-sm"> 97- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3.5V12.5H3.5V3.5H12.5Z" stroke="currentColor"/></svg> 101+ {@render squareIcon()} 102 </Button> 103 </div> 104 <div class="flex flex-wrap gap-3 items-center"> 105 <Button variant="outline"> 102- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3.5V12.5H3.5V3.5H12.5Z" stroke="currentColor"/></svg> 106+ {@render squareIcon()} 107 With Icon 108 </Button> 109 <Button variant="outline">Without Icon</Button> 110 <Button size="icon" variant="outline"> 107- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3.5V12.5H3.5V3.5H12.5Z" stroke="currentColor"/></svg> 111+ {@render squareIcon()} 112 </Button> 113 </div> 114 <div class="flex flex-wrap gap-3 items-center"> 115 <Button variant="ghost"> 112- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3.5V12.5H3.5V3.5H12.5Z" stroke="currentColor"/></svg> 116+ {@render squareIcon()} 117 With Icon 118 </Button> 119 <Button variant="ghost">Without Icon</Button> 120 <Button size="icon" variant="ghost"> 117- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 3.5V12.5H3.5V3.5H12.5Z" stroke="currentColor"/></svg> 121+ {@render squareIcon()} 122 </Button> 123 </div> 124 </div>
Environment
Buildtrue
Teststrue
Archaarch64
OSDarwin 14.6.1
CPUApple M2
Agentpi-autoresearch / pi
Filessrc/routes/+page.svelte