This document describes the current large-file graph behavior and the benchmark command used for v1.8 validation.
JSONMap switches to large-file graph mode when the active document is larger than 1 MiB.
Expected behavior:
- Graph parsing and transformation run outside the React render path through the worker-backed processing pipeline.
- Large JSON input emits a shallow
previewgraph first, then a deepercompletegraph. - The complete large-file graph is capped to 500 nodes and 50 children per branch.
- Branches beyond the configured depth or child limit are marked as deferred and can be loaded on demand.
- Scalar labels are shortened for readability.
- Full scalar values are omitted from graph node payloads in large-file mode to avoid duplicating large strings across UI state.
- Full JSON content remains available in the editor, versioning system, export flow, and subtree actions.
The graph benchmark uses generated in-memory JSON fixtures so the repository does not store large blobs.
| Fixture | Target size | Purpose |
|---|---|---|
1 MiB |
1,048,576 bytes | Minimum large-file mode boundary. |
5 MiB |
5,242,880 bytes | Medium local API payload or exported dataset. |
20 MiB |
20,971,520 bytes | Stress fixture for local-first graph processing. |
Run:
pnpm benchmark:graphThe command generates all fixtures in memory, runs processGraphRequest, and prints a Markdown table with:
- generated byte size,
- processing duration,
- emitted processing stages,
- preview and complete graph node counts,
- deferred branch count,
- large-file mode status.
Example measured on the maintainer's local macOS development machine on 2026-04-29.
| Fixture | Bytes | Duration | Stages | Preview nodes | Complete nodes | Deferred branches | Large-file mode |
|---|---|---|---|---|---|---|---|
| 1 MiB | 1,062,923 | 44.4 ms | preview -> complete | 4 | 57 | 51 | yes |
| 5 MiB | 5,331,280 | 40.6 ms | preview -> complete | 4 | 57 | 51 | yes |
| 20 MiB | 21,386,297 | 91.1 ms | preview -> complete | 4 | 57 | 51 | yes |
These numbers are hardware-dependent. Treat them as a local sanity check, not a public performance guarantee.