Blog 4 min read
Svelte vs React: does the framework matter for a realtime database view?

DBFrog draws every database as a live scene: panels for connections, queries, buffers and replication, joined by animated data flows that refresh while you watch. The UI is written in Svelte. We wanted to know whether React would cost us anything, so we ported the PostgreSQL view and measured both.
What we compared#
- Svelte: the real DBFrog scene component, mounted alone on a test page.
- React 19: a port of the PostgreSQL part of that scene: the six PostgreSQL panels, the data-flow pipes and the widgets. Same markup, class names and CSS. Each panel subscribes to the data store with
useSyncExternalStoreand is wrapped inmemo; no further tuning.
Both builds share the same TypeScript for everything that is not the framework: the canvas animation engine, the seeded demo data source, layout and formatting. Only the reactive glue differs, so the numbers show the cost of the framework and nothing else.
A real DBFrog server sends one data frame per second. To stress the update path, the benchmark raised that to 10 and 60 frames per second, and repeated every run with Chrome’s CPU slowed down 4× to imitate a weak laptop. Each case ran 3 times for 15 seconds after a 5-second warm-up in headless Chrome on Linux; the tables show medians.
Results#
Script time is main-thread JavaScript per second of wall time; lower is better. “Frame to DOM” is the time from a data frame arriving to the page showing it.
| CPU | Frames/s | App | Script ms/s | FPS | Dropped frames | Frame to DOM p50 | Frame to DOM p95 | Heap |
|---|---|---|---|---|---|---|---|---|
| 1× | 1 | Svelte | 17.5 | 60 | 0 | 1.5 ms | 2.1 ms | 21.7 MB |
| 1× | 1 | React | 17.2 | 60 | 0 | 1.8 ms | 2.3 ms | 21.6 MB |
| 1× | 10 | Svelte | 28.6 | 60 | 0 | 1.2 ms | 1.6 ms | 21.8 MB |
| 1× | 10 | React | 31.5 | 60 | 0 | 1.4 ms | 1.7 ms | 21.8 MB |
| 1× | 60 | Svelte | 83.1 | 60 | 0 | 1.0 ms | 1.4 ms | 22.2 MB |
| 1× | 60 | React | 100.9 | 60 | 0 | 1.2 ms | 1.8 ms | 22.2 MB |
| 4× slower | 1 | Svelte | 48.6 | 60 | 0 | 5.8 ms | 7.5 ms | 21.7 MB |
| 4× slower | 1 | React | 55.0 | 60 | 0 | 7.7 ms | 10.0 ms | 21.6 MB |
| 4× slower | 10 | Svelte | 105.2 | 60 | 4 | 5.0 ms | 7.9 ms | 21.8 MB |
| 4× slower | 10 | React | 123.6 | 60 | 3 | 6.3 ms | 11.5 ms | 21.8 MB |
| 4× slower | 60 | Svelte | 200.0 | 48 | 190 | 4.6 ms | 8.2 ms | 22.1 MB |
| 4× slower | 60 | React | 243.1 | 45 | 225 | 5.9 ms | 10.6 ms | 22.2 MB |
No run had a long task (over 50 ms) in either app.
What the numbers say#
- At the real rate they tie. One frame per second on a normal CPU: 17.5 vs 17.2 ms of script per second, 60 fps, no long tasks. On a 4× slower CPU React needs 13 % more script time at that rate.
- Under stress React does more work. React spends 10 % more script time at 10 frames per second and 21 % more at 60, and 13 to 22 % more on the slow CPU.
- Svelte reaches the screen sooner. From data arrival to DOM change Svelte is 0.2 to 1.9 ms faster at the median, because React schedules its render in a later task.
- Smoothness is the same. Both hold 60 fps up to 10 frames per second even on the slow CPU. At 60 frames per second on the slow CPU both fall to about 45 to 48 fps, where the canvas animation already fills the main thread.
- Memory is the same: about 22 MB of heap in every case.
Most of the main-thread time goes to the shared canvas animation, not to either framework. That is why the gap is small at normal load and only opens up when we push ten to sixty times the real update rate.
Caveats#
The React port covers PostgreSQL only. Zoom and pan, tooltips, threshold badges, the other database engines and the app chrome were not ported, and they sat idle during the Svelte runs too. Bundle sizes are not comparable for the same reason: the Svelte scene imports the panels of all five engines (MySQL, MongoDB, SQL Server and Redis as well), the React port only PostgreSQL. A headless browser on one Linux machine is also not every user’s laptop; the 4× CPU slowdown is our stand-in for slower hardware.
Conclusion#
There is no performance reason for DBFrog to move to React. Svelte is equal at the update rate real servers send and somewhat cheaper when the view is under load, so the live scene stays in Svelte. If you want to see that scene on your own databases, DBFrog shows PostgreSQL, MySQL, MongoDB, SQL Server and Redis live, with history replay and AI-driven tuning.


