You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid cloning the entire document type for each reservation #6305
PastaClaw flagged this while reviewing #5749, where it was deferred to a follow-up instead of being fixed in that pull request. This issue tracks the follow-up.
Avoid cloning the entire document type for each reservation (suggestion)
Where:packages/rs-dpp/src/data_contract/document_type/mod.rs:466-467 at 86bbb70a1a2e:
with_only_indexes is called during every indexed-random insertion, but to_owned_document_type deep-clones DocumentTypeV2 before filtering it. Its derived Clone copies the owned schema, both property maps, constraints, indexes, and the original index structure, which keep_only_indexes then replaces. Pricing one small random index therefore allocates in proportion to the whole type definition for each document. Build a filtered index representation that borrows unchanged metadata, or cache the projection by contract version and document type, instead of repeating the deep clone per create. Registration is currently inactive, so this is a nonblocking hot-path improvement before activation.
Activity