Skip to content

Build coding paths lazily and read arrays in place - #64

Open
letko-dmitry wants to merge 22 commits into
almazrafi:mainfrom
letko-dmitry:feature/fast-paths
Open

letko-dmitry wants to merge 22 commits into
almazrafi:mainfrom
letko-dmitry:feature/fast-paths

Conversation

@letko-dmitry

@letko-dmitry letko-dmitry commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #63: only the last 2 commits are new, and either can be dropped.

  • Coding paths are built only when an error needs them, not for every nested value (−6% encoding, −4% decoding).
  • Arrays are read in place instead of being copied into [Any?] up front (−21% decoding). Elements that are optionals themselves unwrap as before, and a test covers it.

Behavior doesn't change. Together with #61–#63, encoding is 27% faster than on main and decoding 35%.

Measured in retired instructions with alternating A/B runs, release builds on an M4; noise is within ±0.3%.

@letko-dmitry
letko-dmitry marked this pull request as ready for review October 5, 2026 18:45
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