Performance hot paths plus attribute set semantics, entity involvements, and serializer ordering#16
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
QualifiedNameEscaper::escape(), a lookup cache onPrefixMinter::prefixFor(), lazy blank-label collection inJsonSerializer, qualified-name string-form reuse, a decode guard on JSON deserialization, and namespace-URI-based pruning in the builders.Attributesnow collapses identical attribute-value pairs in its constructor (PROV-DM models a record's attributes as a set of pairs), guarded so single-valued keys pay nothing. Value identity moves to the new internalValueIdentity, shared withDocumentComparatorso dedup and equality always agree, including the bare-scalar vs typed-Literalcross-type case. Observable only ascount()dropping for inputs that carried duplicate pairs.Attributes::merge(): it had no production callers, and the multimap is built viawith(),from(), andAttributesBuilder.RecordContainer::entityInvolvements(), a forward pass yielding a publicEntityInvolvement(relationType,role,entity) per entity-typed relation endpoint, so a consumer can derive a secondary index from a finished Document or Bundle. A typed derivation reports its subtype (wasRevisionOfetc.), androledistinguishes endpoints such asgeneratedEntityfromusedEntity.RecordBuilder::autoDeclareEntities(): atbuild()it emits a bareEntityfor any entity-typed relation endpoint no record declares, skipping blank nodes and already-declared identifiers and propagating to bundles. Off by default.sortRecordsflag that orders records into PROV-DM concept order (elements, then relations in component order, then by identifier). Ordering is non-semantic in every PROV format, so round-trips and semantic equality are unaffected.