Skip to content

perf: preallocate snapshot v2 imports - #390

Merged
Byron merged 1 commit into
mainfrom
snapshot-v2
Aug 30, 2026
Merged

perf: preallocate snapshot v2 imports#390
Byron merged 1 commit into
mainfrom
snapshot-v2

Conversation

@Byron

@Byron Byron commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Tasks

  • review

Snapshot V2 prefixes the record stream with the total node count and native
path-name bytes. Interactive imports use them for exact reservations while V1
remains readable and declared requirements are validated.

~/dev benchmark

dua i --import SNAPSHOT --once, release builds; one frozen V1 traversal converted to V2 for identical contents.

Metric V1 V2 Change
Median peak RSS (5 runs) 369,868,800 B 230,473,728 B -37.7%
Mean wall time (20 runs) 430.5 ± 1.8 ms 438.1 ± 2.8 ms +1.8%
Compressed snapshot size 38,215,358 B 38,215,404 B +46 B

<!-- agent -->
Snapshot V2 prefixes the record stream with the total node count and native
path-name bytes. Interactive imports use them for exact reservations while V1
remains readable and declared requirements are validated.

## `~/dev` benchmark

`dua i --import SNAPSHOT --once`, release builds; one frozen V1 traversal converted to V2 for identical contents.

| Metric | V1 | V2 | Change |
| --- | ---: | ---: | ---: |
| Median peak RSS (5 runs) | 369,868,800 B | 230,473,728 B | -37.7% |
| Mean wall time (20 runs) | 430.5 ± 1.8 ms | 438.1 ± 2.8 ms | +1.8% |
| Compressed snapshot size | 38,215,358 B | 38,215,404 B | +46 B |

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
@Byron
Byron merged commit ebf4cff into main Aug 30, 2026
3 checks passed
@Byron
Byron deleted the snapshot-v2 branch August 30, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant