Skip to content

Use active sequences for container decoding - #397

Open
ruslandoga wants to merge 4 commits into
masterfrom
rd/tuple-decoding-frames
Open

Use active sequences for container decoding#397
ruslandoga wants to merge 4 commits into
masterfrom
rd/tuple-decoding-frames

Conversation

@ruslandoga

@ruslandoga ruslandoga commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Keeps active container state in decoder arguments and stores frames only at nesting boundaries, avoiding expanded type lists and per-item continuation allocation. Small compile-time transition macros remove repeated state plumbing without adding runtime state objects; arrays reuse one schema, tuples traverse original schema tails, and maps build directly as each pair completes. Benchmarks show arrays of 3–100 items about 1.2–2.9x faster, maps with 1–10 pairs about 2.5–5.4x faster, and three-field tuples using 12% fewer reductions and 10% less memory than master. Tested with MIX_ENV=test mix test (475 passed), and macro-versus-explicit benchmarks use identical memory across array sizes.

@ruslandoga ruslandoga changed the title Use frames for container decoding Use active sequences for container decoding Aug 3, 2026
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