Repository navigation
Conversation
Every attribute, entity and property requirement fetched the same items with getItemsData, and each call has a large fixed cost in the fragments worker. IDSSpecification.test now lets its requirements share one fetch per kind of item data. IDSProperty no longer adds type properties into the fetched occurrence sets, since that data is now shared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erty
In fragments' getItemsData a relation without its own entry in `relations`
takes the config of the relation it was reached through. The type reached
through IsDefinedBy ({ relations: true }) therefore followed ObjectTypeOf to
every other instance of that type, with all their property sets. On models
where many elements share types, one fetch could pull in most of the model.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Description
Each attribute, entity and property requirement of a specification calls
model.getItemsDatafor the same applicable items. Each call has a large fixed cost in the fragments worker. On a 15 MB model, one call took ~4 s, and 10 calls of 200 items took 45 s against 7.5 s for one call of 2 000. A specification with many property requirements spends nearly all its time re-fetching.IDSSpecification.test()opens a shared scope for its applicable items. Requirements fetch each kind of item data once (attributes; property-set relations) and share it. Outside a specification run, facets fetch as before.IDSProperty.getPsets()no longer modifies the fetched occurrence sets when adding type properties. It works on a copy, since the data is now shared.IDSProperty.test()'s fetch no longer follows an element's type back to its other instances. IngetItemsData, a relation without its own entry takes the config of the relation it was reached through. SoObjectTypeOfunder the type inheritedIsDefinedBy'srelations: trueand returned every instance of the type with all their property sets. It is now listed as{ attributes: false, relations: false }, asDefinesOccurrencealready was. On a 9 600-object model with shared types, one such fetch ran for over 8 minutes without finishing.Additional context
specification-items-data.test.ts: five requirements make two full fetches instead of five, and the results equal those of each requirement run on its own. No fetched item data containsObjectTypeOf; that test fails without the config change.IDSFacet.startSharedItemsData/endSharedItemsData(static) and the protectedgetSharedItemsData. The cache is a module-levelWeakMapkeyed on the applicable-items object of one run, so separateComponentsinstances don't share anything. Happy to make these internal if you prefer another shape, e.g. passing a cache in theconfigargument oftest().What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following:
🤖 Generated with Claude Code