Svelte 5.57.1 · Chromium 153

$state vs $state.raw at scale

Putting a big list into $state is free. Reading all of it is not. From about 10,000 rows, a $derived total turns a one-row edit into a full scan through the proxy. And for some edits, $state is the faster choice.

Edit one row, with a $derived total

1,000 rows
$state 0.4 ms
$state.raw 0.1 ms
10,000 rows
$state 4.3 ms
$state.raw 0.3 ms
100,000 rows
$state 48 ms
$state.raw 2.2 ms
250,000 rows
$state 123 ms
$state.raw 5.3 ms
median of 5 runs · unthrottled · 30 Sep 2026 · log scale
The problem

The cost isn't where you expect it

0.1 ms

Assigning is free

Assigning 100,000 rows to $state took 0.1 ms and no extra memory. Svelte creates proxies when rows are read, not when you assign.

120 ms

The first full read pays

The first read of every row took 120 ms and 112 MB more heap (100,000 rows). Every $derived total, filter or sort is a full read, on every change.

1.8 ms

And sometimes $state wins

Editing a row again in a fully rendered list of 100,000: $state 1.8 ms, $state.raw 20 ms. That is why the rule is "make only the rows that change reactive".

Measured on a production build · 30 Sep 2026

100,000 rows, five ways to hold them

Playwright Chromium 153 against node build. One fresh page per configuration, 1 warm-up and 5 measured runs, median shown. Unthrottled, Windows 11, i9-13900KF. Thresholds are machine- and version-specific. Fastest in lime, slowest in red.

Operation$state$state.rawhybridclassSvelteMap
assign (+ first $derived total)153 ms0.4 ms1.5 ms66 ms18 ms
edit one row, $derived total48 ms2.2 ms3.3 ms1.3 ms2.1 ms
edit it again, full list rendered1.8 ms20 ms2.1 ms1.6 ms16 ms
sort ($state: in place / as a copy)453 / 373 ms24 ms41 ms57 msn/a
filter via $derived74 ms2.1 ms4.6 ms17 ms1.3 ms
heap after a full read148 MB0.00.026 MB16 MB

Hybrid: a raw list where a row becomes reactive on its first edit. Class: rows as class instances with $state fields. At 1,000 rows, the largest difference between variants was 2.0 ms (unthrottled, no full list on screen): choose for readability there.

Measured Rules · 8 rules, 14 passing tests

A decision rule your assistant can follow

Your assistant keeps writing the code. The rules tell it which pattern to use and why, in the format it reads: a Claude skill, a Cursor rule, Copilot instructions or AGENTS.md. Every rule names the test that backs it.

  1. 01 Up to about 1,000 rows, choose for readability, not speed. in the pack
  2. 02 From about 10,000 rows, if anything reads every row when the list changes, use $state.raw with immutable updates. free
  3. 03 Never mutate $state.raw in place. free
  4. 04 A big list that is only read a window at a time can stay $state. in the pack
  5. 05 Make only the rows that change reactive. in the pack
  6. 06 Compare rows by id, never by identity, when a $state array is involved. in the pack
  7. 07 Keep $state.snapshot of big lists out of hot paths. in the pack
  8. 08 Don't choose between $state and $state.raw for server rendering speed. in the pack

Rules 2 and 3 are free in the demo README. The pack adds the rest, templates, an audit prompt, a PR checklist and the tests to run in your own repo.

What you get

The guide, the rules and the audit

Guide cover: Big Lists in Svelte 5 StateGuide page: chapter 1, What a $state proxy costs
Guide 04, draft PDF · 17 pages, 3 chapters
  • Chapter 1: what a $state proxy costs. Lazy proxies, full reads, memory, where $state wins.
  • Chapter 2: the decision rule, with thresholds at 1x and 4x CPU, and which rows to make reactive.
  • Chapter 3: gotchas, migration and measuring your own hot path.
Planned pricing

Pick what you need

Guide

€19 PDF

Base price (bazna cijena) on 16.10.2026: €19

  • The full guide (3 chapters, 17 pages)
  • Every measurement with versions and scripts
  • Free updates to this edition
Join the waitlist

Team

€199 up to 10 developers

Base price (bazna cijena) on 16.10.2026: €199

  • Everything in Guide + Measured Rules
  • Licence for up to 10 developers of one company
  • Commit the rules to all of your company's repos
Join the waitlist

Planned prices. Sales open soon. The waitlist hears first. Season 1 bundle: all four topics, Guide + Measured Rules for €99 (base price (bazna cijena) on 16.10.2026: €99), or any three topics for the price of two. Prices in euro, VAT included. Payment goes through Paddle, the merchant of record; a business can enter its VAT ID at checkout, and reverse charge then applies where the law allows.

Free now · guides soon

Get the big lists checklist

One page per topic, every check backed by a measurement: section renderer, ssr state, sveltekit defaults and big lists in svelte 5 state.

  1. 1Enter your email. You land on our mailing-list page.
  2. 2Open the confirmation email from hello@measuredfrontend.com and click the link.
  3. 3The confirmation page lists the four PDFs. About one minute in total.

After that: one email when the guides open, and a short note when a new measurement is published. Unsubscribe in one click. No confirmation, no emails: the address is deleted within 30 days.

Double opt-in: nothing is sent until you click the link in that email.

FAQ

Questions

Why not just ask my AI assistant?

It can quote the Svelte docs: use $state.raw for large data you don't mutate. What it can't tell you is where "large" starts, that assigning is not the cost, and where $state is faster. The rules carry measured thresholds, labelled with machine and versions, and the audit script finds big lists in your own code.

Doesn't the Svelte documentation already say this?

Yes, and I quote it word for word. It says raw avoids the cost of making large data reactive, and that raw state can contain reactive state. I add the numbers: where "large" starts on one machine, why assigning is free, where $state wins, and a measured way to choose which rows are reactive.

Nobody renders 100,000 rows.

True, and you don't have to. In a windowed list, editing one of 250,000 $state rows took 0.1 ms. The cost comes from full reads: $derived totals, filters and sorts over the whole list. Those show at 10,000 rows too.

Your i9 isn't my users' phone.

Right. There is a 4x CPU-throttled run (a rough mid-range phone, not a device measurement), the ratios carry over, and the guide shows how to time your own hot path with a 10-line helper.

Are class rows the obvious answer?

Sometimes. They were faster for repeated edits (1.3 vs 2.2 ms per edit at 100,000 rows) and slower when the list is replaced (66 vs 0.4 ms per assign). The guide has the decision rule.

When can I buy it?

Sales open soon. The waitlist hears first: one email when it opens, and the free big-lists checklist right after you confirm.