Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 asBasicAliasDereferencingStrategy
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