Skip to content
.md

Sizing

How much memory a project needs and how fast it answers depends on the shape of its models more than on the number of rows. The figures below are measurements on three model shapes, so you can pick the one closest to yours and scale it by your row count.

How it was measured (2026-11-21): @dcupl/core 2.2.3 (npm latest), Node.js 24.18, an Apple M1 Pro laptop. Synthetic, deterministic data with valid rows (no quality errors), loaded with models.set() and data.set(), then init(). Each measurement runs in a fresh process. Retained heap is the memory still in use after garbage collection once init() has finished and your own code no longer holds the raw rows. Default is new Dcupl() without options; production mode is quality: { enabled: false } plus performance: { retainStagedData: false } (see Production mode).

Shape Model
Narrow 6 properties: name, SKU, price, stock, active flag, color
Wide 30 properties: 14 strings (one a 55–77 character description), 11 numbers, 2 booleans, 2 dates, a string array
With references 12 properties (one derived from a reference) and 3 references (two single-valued, one multi-valued) to small lookup models of 240, 600 and 40 rows

Memory per row

Shape Per row, default Per row, production mode 10,000 rows 50,000 rows 200,000 rows 1,000,000 rows
Narrow about 0.5 KB about 0.4 KB 5 → 4 MB 23 → 18 MB 91 → 71 MB 445 → 346 MB
Wide about 3.4 KB about 2.8 KB 33 → 27 MB 161 → 134 MB 644 → 535 MB not measured
With references about 1.8 KB about 1.5 KB 18 → 15 MB 87 → 71 MB 346 → 283 MB 1,712 → 1,397 MB

Each cell is the retained heap with the default options → in production mode. The cost per row stays flat from 10,000 to 1,000,000 rows, so memory grows linearly with the row count. For comparison, the same rows held as plain JavaScript objects take about 0.3 KB (narrow), 1.2 KB (wide) and 0.9 KB (with references) per row: a loaded instance in production mode holds about 1.1–2.3 times its raw data, because it keeps the items together with their indices.

To estimate your project, multiply your row count by the per-row figure of the closest shape and leave headroom for your own code and for the caches that queries build (cache.maxSize bounds them). Rows with many quality errors cost more while quality checks are on: an atypical, error-heavy catalog of 23,754 rows with about 14 recorded errors per row retained 110 MB with the default options (see Quality reports).

Query, facet and init timings

Default options, same machine and SDK. Filter columns: one condition on a new list, then a page of 20 items and the total from fn.metadata().currentSize; eq on a string matches about 8 % of the rows and scans them, range is price gte a value (40–100 % of the rows match), eq on a reference is an index lookup (under 1 % match). Facets: fn.facets() on color (12 values); the first call builds the facet index, the next columns are facets on a list filtered by price, without and with skipKeys: true. Every figure is the fastest of 3 rounds per value, the median over 12 values and the median of 3 runs.

Shape Rows init() eq on a string Range eq on a reference First facet call Facets Facets, skipKeys
Narrow 10,000 14 ms 1.1 ms 3.3 ms — 4.4 ms 2.4 ms 2.2 ms
Narrow 50,000 47 ms 6.4 ms 20 ms — 16 ms 15 ms 13 ms
Narrow 200,000 165 ms 37 ms 109 ms — 96 ms 90 ms 75 ms
Wide 10,000 48 ms 1.5 ms 6.9 ms — 7.4 ms 4.4 ms 3.9 ms
Wide 50,000 202 ms 9.9 ms 67 ms — 38 ms 46 ms 43 ms
Wide 200,000 816 ms 55 ms 313 ms — 174 ms 211 ms 192 ms
With references 10,000 72 ms 1.4 ms 4.2 ms 0.8 ms 4.8 ms 3.2 ms 2.8 ms
With references 50,000 214 ms 8.0 ms 31 ms 5.8 ms 24 ms 23 ms 21 ms
With references 200,000 804 ms 50 ms 191 ms 32 ms 121 ms 146 ms 128 ms

Query time grows with the number of rows in the model, also for index lookups; plan with the 200,000-row figures as the upper end measured here. A repeated read of an unchanged query comes from the list's cache. On these error-free rows production mode changes the timings by less than 10 %; its savings in init() show on real data with quality errors (see Production mode).

Bundle size

Measured on 2026-11-21 with @dcupl/core and @dcupl/loader 2.2.3: an esbuild bundle of an entry that imports Dcupl (and DcuplAppLoader), minified, browser platform, target ES2020.

Bundle Minified gzip Brotli
@dcupl/core 283 KB 78 KB 63 KB
@dcupl/core + @dcupl/loader 384 KB 110 KB 78 KB

@dcupl/loader is needed only to load an application from the Console (dcupl.lc.json); an app that passes its models and data to models.set() and data.set() ships @dcupl/core alone. To keep dcupl out of your first page load, import it where the data is needed (const { Dcupl } = await import('@dcupl/core')), so your bundler puts it in its own chunk.

REST API instances

A REST API instance runs the same SDK and holds its own copy of the loaded data, so the memory per row above applies to it too. On the dcupl cloud runtime an instance may use up to 3 GB of heap and answers one request at a time; Sizing and limits lists every limit, and what to do when an instance runs out of memory.

Limits of the environment

Where the SDK runs sets the ceiling: browser memory varies by device, Node.js has a heap limit you can raise with --max-old-space-size, and a model holds at most about 16.7 million items. See Data size and limits.