Skip to content

Add token-stream readable maps with a shared context - #59627

Open
javache wants to merge 1 commit into
react:mainfrom
javache:export-D128313426
Open

javache wants to merge 1 commit into
react:mainfrom
javache:export-D128313426

Conversation

@javache

@javache javache commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary:
Add experimental TokenStreamMap and TokenStreamContext adapters for typed access to binary token-stream data. One shared context owns the document, indexes containers and string literals, and supports independent out-of-order map and array reads.

The default constructor snapshots caller-owned bytes; fromOwnedBytes accepts explicit ownership transfer without copying. Reopened maps reuse one field index per container, each string is decoded once even with concurrent readers, and numeric text is parsed once during validation. Typed access does not materialise map values. Explicit map/list conversion creates independent mutable collections using an iterative walk.

Changelog: [Android][Added] - Add experimental token-stream-backed readable maps with shared string contexts

Differential Revision: D128313426

Summary:
Add experimental TokenStreamMap and TokenStreamContext adapters for typed access to binary token-stream data. One shared context owns the document, indexes containers and string literals, and supports independent out-of-order map and array reads.

The default constructor snapshots caller-owned bytes; fromOwnedBytes accepts explicit ownership transfer without copying. Reopened maps reuse one field index per container, each string is decoded once even with concurrent readers, and numeric text is parsed once during validation. Typed access does not materialise map values. Explicit map/list conversion creates independent mutable collections using an iterative walk.

Changelog: [Android][Added] - Add experimental token-stream-backed readable maps with shared string contexts

Differential Revision: D128313426
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 29, 2026
@meta-codesync

meta-codesync Bot commented Oct 29, 2026

Copy link
Copy Markdown

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D128313426.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant