SvelteKit
SvelteKit scores 23 of 28 points. That is 13 of 14 on the 7 features that affect first paint (the moment the browser first draws content), and 10 of 14 on the 7 other features.
- Version checked
- @sveltejs/kit ^3.0.1 (lockfile 3.0.1; latest 3.4.0), Vite ^8.1.5 (lockfile 8.3.0)
- Version notes
- optimized branch; Vercel ISR adapter; Unpic + IPX; Fontsource
- Performance guide
- Performance • SvelteKit Docs
- Issues
- github.com/sveltejs/kit/issues
Scorecard
All 14 features, in two groups. Each row shows SvelteKit's label, how that label compares across all 23 frameworks, and how to enable the feature. Feature names link to SvelteKit's entry on that feature's page.
SvelteKit's labels across 14 features
- 1st-party10
- Experimental0
- Third-party3
- Manual1
- of 14
How it compares
On 10 of 14 features, no framework has a higher-scoring label than SvelteKit. On the other 4, at least one does.
Tested in our port
The svelte-books port passes 11/11 feature tests. Run on 2026-11-26 at MaxwellCohen/svelte-books@bb5025f. How we test labels
First-paint levers
- 01Production CSS inlining1st-party2 pts
1st-party, like 7 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Set
inlineStyleThresholdhigh enough (e.g.Number.POSITIVE_INFINITY; the docs define it as the max CSS file length in UTF-16 code units) invite.config.ts. One line, but you have to know it exists.sveltekit({ inlineStyleThreshold: Number.POSITIVE_INFINITY, })From this repo's
svelte-books/vite.config.ts(optimizedbranch). - 02Font optimizationThird-party1 pt
Third-party, like 18 of the other 22 frameworks. 4 frameworks score higher.
Show the how-toHide the how-to
Import
@fontsource-variable/geist(Fontsource). SvelteKit has no first-party font module and does not preload fonts by default; thehandlehook'sresolve(..., { preload })filter can add font preloads (not used here), so the font is discovered from the inlined stylesheet.@import "@fontsource-variable/geist";From this repo's
svelte-books/src/routes/layout.css(optimizedbranch). - 03Image pipeline1st-party2 pts
1st-party, like 8 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
The framework offers
@sveltejs/enhanced-img, a build-time plugin that only optimizes image files present at build. For remote images such as this port's covers the same page points to a CDN and names the community@unpic/svelte, so this port uses Unpic transforms plus anipxhandler (src/lib/server/ipx-handler.ts), disabled on Cloudflare.adapter-vercelalso has animagesoption (not used here). To use the first-party route for local files:enhancedImages(), // must come before the SvelteKit plugin<enhanced:img src="./path/to/your/image.jpg" alt="An alt text" />Adapted from the images docs.
Art direction with <picture>
1st-partyServing a different crop or format per screen size. Not scored: the label shows how much the framework does for you.
enhanced:img(local files only) is replaced at build time by an<img>wrapped in a<picture>with multiple formats and sizes; that is modern formats, not breakpoint art direction. Setup is the plugin line shown in section 3:<enhanced:img src="./path/to/your/image.jpg" alt="An alt text" />From the images docs.
- 04Data/HTML caching1st-party2 pts
1st-party, like 16 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Use
adapter-vercel's per-routeisroption, exported asconfigfrom a route, as done insrc/lib/server/page-isr.ts. SvelteKit also has first-party, host-independent pieces:setHeadersinloadforcache-control(this port sets it insrc/routes/+layout.server.ts) and per-routeprerender. The experimental remote functions only dedupe aquerywithin one request (and share it on the client while it is in use); theirprerendervariant stores build-time data. This port turns on theremoteFunctionsflag but defines no remote functions. A cross-request data cache on other hosts is manual:src/lib/server/catalog-cache.tswith Vercel Cache, Netlify Blobs, and the Workers KV/Cache API paths.export const catalogIsrConfig = { isr: { expiration: CATALOG_CACHE_REVALIDATE_SECONDS, allowQuery: ['page', 'search'] } } satisfies Config;// src/routes/+page.server.ts export const config = catalogIsrConfig;From this repo's
svelte-books/src/lib/server/page-isr.tsandsrc/routes/+page.server.ts(optimizedbranch;allowQueryshortened and spread removed). - 05Route prefetching1st-party2 pts
1st-party, like 18 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Set
data-sveltekit-preload-data="hover". This repo'sFastLinkwrapper maps apreloadprop to that attribute per link ('hover'or'off'); the pagination and sidebar links pass it explicitly and book cards passpreload={eagerPrefetch}. The starter template already sets the attribute on<body>, and JS/CSS are preloaded automatically (performance).<body data-sveltekit-preload-data="hover">From this repo's
svelte-books/src/app.html(optimizedbranch; class attribute omitted). - 06Streaming SSR1st-party2 pts
1st-party, like 17 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Return a promise from a server
loadwithout awaiting it (streaming with promises). The page renders with the awaited data, and each promise is streamed to the browser when it resolves;{#await}shows the placeholder.export async function load({ params }) { return { comments: loadComments(params.slug), post: await loadPost(params.slug) }; }From the SvelteKit
loaddocs (comments omitted). - 07Early Hints / preload headers1st-party2 pts
1st-party, like 3 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Set
output.linkHeaderPreload: true(SvelteKit 3.0+, defaultfalse). Pages that are not prerendered then preload their JS and CSS through the HTTPLinkheader instead of<link>elements. SvelteKit does not document sending a 103 itself.sveltekit({ output: { linkHeaderPreload: true, }, })Adapted from the
outputconfig docs; the option sits next toinlineStyleThresholdin this repo'ssvelte-books/vite.config.ts, which does not set it.
Other features
- 08Islands / partial hydration / lazy slicesManual0 pts
Manual, like 2 of the other 22 frameworks. 20 frameworks score higher.
Show the how-toHide the how-to
No first-party islands are documented; all interactive components hydrate, though disabling hydration for a whole route is possible (page options):
export const csr = false;From the page options docs.
- 09Per-route render modes1st-party2 pts
1st-party, like 18 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Export
prerender,ssr, andcsrper route (page options).export const prerender = true; export const ssr = false; export const csr = false;From the page options docs (each is a separate option; combine as needed).
- 10Fine-grained client reactivity1st-party2 pts
1st-party, like 21 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Runes (
$state,$derived,$effect). Dependencies are picked up at runtime from whatever a$derivedor$effectreads, not by compile-time analysis, and$stateproxies trigger granular updates. Nothing to enable.let isOpen = $state(false);From this repo's
svelte-books/src/lib/features/book/components/MobileBookSidebar.svelte(optimizedbranch). - 11Built-in bundle analysisThird-party1 pt
Third-party, like 18 of the other 22 frameworks. 2 frameworks score higher.
Show the how-toHide the how-to
No built-in analyzer; the performance docs suggest rollup-plugin-visualizer in
vite.config.ts. Not configured in this port. No config snippet for it was found in the docs.Code example
Add
rollup-plugin-visualizeraftersveltekit()in the Vite config.vite buildthen writes a treemap of the bundle tostats.html.// vite.config.ts import { sveltekit } from '@sveltejs/kit/vite'; import tailwindcss from '@tailwindcss/vite'; import { visualizer } from 'rollup-plugin-visualizer'; import { defineConfig } from 'vite'; export default defineConfig({ plugins: [ tailwindcss(), sveltekit({ /* … */ }), visualizer({ filename: 'stats.html', gzipSize: true }) ] });Source: SvelteKit: Performance
- 12Third-party script strategiesThird-party1 pt
Third-party: the only framework of 23 with this label. 5 frameworks score higher.
Show the how-toHide the how-to
No first-party script primitive is documented; the performance docs point to Partytown's SvelteKit integration (community package
@qwik.dev/partytown) for running third-party scripts in a web worker. Otherwise add the tag inapp.htmlor a component and manage ordering yourself. Not configured in this port.Code example
Install
@qwik.dev/partytown, add its Vite plugin, and print the Partytown snippet in the root layout. Scripts taggedtype="text/partytown"then run in a web worker instead of the main thread.// vite.config.js import { sveltekit } from '@sveltejs/kit/vite'; import { partytownVite } from '@qwik.dev/partytown/utils'; export default { plugins: [sveltekit(), partytownVite()] };<!-- src/routes/+layout.svelte --> <script> import { partytownSnippet } from '@qwik.dev/partytown/integration'; </script> <svelte:head> <script> // Forward the necessary functions to the web worker layer partytown = { forward: ['dataLayer.push'] }; </script> {@html '<script>' + partytownSnippet() + '</script>'} <script type="text/partytown" src="https://www.googletagmanager.com/gtag/js?id=YOUR-ID-HERE"></script> </svelte:head>Source: Partytown: SvelteKit
- 13Portable multi-host deployment1st-party2 pts
1st-party, like 7 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Pick an
adapterfor Node, Vercel, Netlify, Cloudflare, or static output.const adapter = isCloudflare ? cloudflareAdapter : process.env.NETLIFY ? netlifyAdapter : vercelAdapter; // ... sveltekit({ adapter: adapter() })From this repo's
svelte-books/vite.config.ts(optimizedbranch; other options omitted). - 14Service worker / offline support1st-party2 pts
1st-party, like 1 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Create
src/service-worker.js(orsrc/service-worker/index.ts). SvelteKit bundles it and registers it automatically, and the$service-workermodule gives it the built files, the static files, and a version string.import { build, files, version } from '$service-worker'; const CACHE = `cache-${version}`; const ASSETS = [...build, ...files];Adapted from the SvelteKit service workers docs (the
install,activate, andfetchhandlers that use these are omitted).
1st-party scores 2 points, Experimental and Third-party 1, Manual 0. How scoring works
The port
The books demo app built with this framework, and where each branch is deployed.
- App
- svelte-books
- Repository
- github.com/MaxwellCohen/svelte-books
Branch
main
vibe port
- Vercel
- svelte-books.vercel.app
- Netlify
- svelte-books.netlify.app
- Cloudflare
- svelte-books.to-email-max.workers.dev
Branch
optimized
cache + fonts
Latest benchmark
Mobile Lighthouse lab results from PageSpeed Insights on : the median of 3 runs per host, averaged across the hosts listed. The benchmark page explains each metric and has every other framework.
| Build | Path | Perf | FCP | Raw FCP | LCP | TBT | CLS | SI | TTI | Doc | Hosts |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Book list / | |||||||||||
| baseline | / | 85 | (good)1.52 | 0.61 | (poor)4.26 | (good)14 | (good)0.000 | 1.88 | 4.26 | 173 | 3/3 Vercel, Netlify, Cloudflare |
| optimized | / | 89 | (good)0.94 | 1.26 | (needs improvement)3.32 | (good)4 | (good)0.000 | 2.95 | 3.43 | 105 | 3/3 Vercel, Netlify, Cloudflare |
| Book page /10145787 | |||||||||||
| baseline | /10145787 | 97 | (good)1.51 | 0.61 | (needs improvement)2.56 | (good)20 | (good)0.000 | 1.83 | 2.56 | 128 | 3/3 Vercel, Netlify, Cloudflare |
| optimized | /10145787 | 99 | (good)0.87 | 0.68 | (good)2.19 | (good)7 | (good)0.000 | 1.49 | 2.22 | 195 | 3/3 Vercel, Netlify, Cloudflare |
- Good
- Needs improvement
- Poor
FCP 1.8 s / 3 s · LCP 2.5 s / 4 s · TBT 200 ms / 600 ms · CLS 0.1 / 0.25
Per host
The medians above before averaging. Runs is how many measured runs went into each median. Host names link to the deployment.
| Build | Path | Host | Perf | FCP | Raw FCP | LCP | TBT | CLS | SI | TTI | Doc | Runs | Status |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SvelteKit | |||||||||||||
| baseline | / | Vercel | 85 | (good)1.54 | 0.23 | (poor)4.21 | (good)25 | (good)0.000 | 1.54 | 4.21 | 84 | 3/3 | OK |
| baseline | / | Netlify | 85 | (good)1.51 | 0.28 | (poor)4.21 | (good)16 | (good)0.001 | 1.51 | 4.21 | 146 | 3/3 | OK |
| baseline | / | Cloudflare | 84 | (good)1.51 | 1.31 | (poor)4.36 | (good)1 | (good)0.000 | 2.59 | 4.36 | 288 | 3/3 | OK |
| baseline | /10145787 | Vercel | 97 | (good)1.51 | 0.23 | (needs improvement)2.56 | (good)17 | (good)0.000 | 1.51 | 2.56 | 87 | 3/3 | OK |
| baseline | /10145787 | Netlify | 96 | (good)1.51 | 1.33 | (needs improvement)2.56 | (good)3 | (good)0.000 | 2.48 | 2.56 | 174 | 3/3 | OK |
| baseline | /10145787 | Cloudflare | 97 | (good)1.51 | 0.28 | (needs improvement)2.56 | (good)41 | (good)0.000 | 1.51 | 2.56 | 124 | 3/3 | OK |
| optimized | / | Vercel | 85 | (good)0.94 | 1.29 | (poor)4.02 | (good)9 | (good)0.000 | 2.98 | 4.09 | 78 | 3/3 | OK |
| optimized | / | Netlify | 84 | (good)0.96 | 2.31 | (needs improvement)3.98 | (good)2 | (good)0.000 | 4.89 | 4.05 | 171 | 3/3 | OK |
| optimized | / | Cloudflare | 99 | (good)0.93 | 0.16 | (good)1.95 | (good)0 | (good)0.000 | 0.97 | 2.15 | 66 | 3/3 | OK |
| optimized | /10145787 | Vercel | 99 | (good)0.92 | 0.27 | (good)2.25 | (good)9 | (good)0.000 | 0.93 | 2.30 | 128 | 3/3 | OK |
| optimized | /10145787 | Netlify | 98 | (good)0.93 | 1.46 | (good)2.23 | (good)7 | (good)0.000 | 2.77 | 2.23 | 300 | 3/3 | OK |
| optimized | /10145787 | Cloudflare | 99 | (good)0.77 | 0.30 | (good)2.10 | (good)4 | (good)0.000 | 0.78 | 2.13 | 157 | 3/3 | OK |