Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference coalescing #435

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

lynchsft
Copy link

@lynchsft lynchsft commented Dec 2, 2024

Yams is able to coalesce references to objects decoded with YAML anchors.

The main use-case for dereferencing aliases in a YML document is when decoding into class types. If the yaml document is large and contains many references (perhaps it is a representation of a dense graph) then, decoding into structs will require the of large amounts of system memory to represent highly redundant (duplicated) data structures.

However, if the same document is decoded into class types and the decoding uses an AliasDereferencingStrategy such as BasicAliasDereferencingStrategy then the emitted value will have its class references coalesced. No duplicate objects will be initialized. In some scenarios this may significantly reduce the memory footprint of the decoded type.

This PR builds on concepts from an earlier PR: #428

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