0
0
Astroframework~8 mins

Why Islands architecture optimizes performance in Astro - Performance Evidence

Choose your learning style9 modes available
Performance: Why Islands architecture optimizes performance
HIGH IMPACT
Islands architecture improves page load speed and interaction responsiveness by reducing JavaScript and DOM work on initial load.
Rendering a mostly static page with some interactive widgets
Astro
Use Islands architecture to render static HTML for the whole page and hydrate only small interactive islands separately as needed.
Smaller JS bundles load faster, hydration is limited to interactive parts, reducing blocking time and improving responsiveness.
📈 Performance GainReduces blocking time by 50-70%; cuts JS bundle size by 60-80%; triggers fewer reflows limited to islands.
Rendering a mostly static page with some interactive widgets
Astro
Render the entire page as a single large React or Astro component with all JavaScript bundled and hydrated at once.
This causes the browser to download, parse, and hydrate a large JavaScript bundle before the page becomes interactive, delaying LCP and increasing input delay.
📉 Performance CostBlocks rendering for 300-500ms on typical devices; large JS bundle adds 100-200kb; triggers multiple reflows during hydration.
Performance Comparison
PatternDOM OperationsReflowsPaint CostVerdict
Single large hydrated appHigh (deep tree)Multiple reflows during hydrationHigh paint cost due to layout thrashing[X] Bad
Islands architectureLow (small islands)Few reflows limited to islandsLower paint cost, faster first paint[OK] Good
Rendering Pipeline
Islands architecture sends mostly static HTML first, so the browser can paint content quickly. JavaScript hydration happens only on small islands, reducing layout and paint work during interaction.
HTML Parsing
Style Calculation
Layout
Paint
Composite
⚠️ BottleneckJavaScript parsing and hydration during Layout and Paint
Core Web Vital Affected
LCP, INP
Islands architecture improves page load speed and interaction responsiveness by reducing JavaScript and DOM work on initial load.
Optimization Tips
1Split interactive UI into small islands to reduce JavaScript bundle size.
2Send static HTML for non-interactive parts to speed up initial paint.
3Hydrate islands separately to minimize layout thrashing and input delay.
Performance Quiz - 3 Questions
Test your performance knowledge
How does Islands architecture improve Largest Contentful Paint (LCP)?
ABy loading all JavaScript before rendering any HTML
BBy sending mostly static HTML first and hydrating only small interactive parts later
CBy using large monolithic JavaScript bundles for all components
DBy delaying all JavaScript until user interaction
DevTools: Performance
How to check: Record a page load and interaction in the Performance panel. Look for long scripting tasks and layout shifts during hydration.
What to look for: Short scripting tasks and minimal layout shifts indicate good islands performance; long blocking scripts and many reflows indicate poor performance.