-
Notifications
You must be signed in to change notification settings - Fork 20
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
fix(react-components): improve asset mapping cache mechanism and refactoring to stabilize rule threshold styling and switching #4652
fix(react-components): improve asset mapping cache mechanism and refactoring to stabilize rule threshold styling and switching #4652
Conversation
… for styling group creation - wip
…t and implement an extra check per item when applying stylings - wip
…e rule base styling
…d-caching-many-asset-mappings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments - I'll have to look a little closer on the changes in AssetMappingCache
, but I think I'll wait until you've had a chance to make changes based on the comments
react-components/src/components/CacheProvider/AssetMappingCache.ts
Outdated
Show resolved
Hide resolved
react-components/src/components/CacheProvider/AssetMappingCache.ts
Outdated
Show resolved
Hide resolved
react-components/src/components/CacheProvider/AssetMappingCache.ts
Outdated
Show resolved
Hide resolved
react-components/src/components/CacheProvider/AssetMappingCache.ts
Outdated
Show resolved
Hide resolved
react-components/src/components/Reveal3DResources/Reveal3DResources.tsx
Outdated
Show resolved
Hide resolved
react-components/src/components/CacheProvider/AssetMappingCacheProvider.tsx
Outdated
Show resolved
Hide resolved
react-components/src/components/CacheProvider/AssetMappingCacheProvider.tsx
Outdated
Show resolved
Hide resolved
react-components/src/components/CacheProvider/Node3DPerNodeIdCache.ts
Outdated
Show resolved
Hide resolved
react-components/src/components/CacheProvider/AssetMappingAndNode3DCache.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
react-components/src/hooks/useConvertAssetMetadatasToLowerCase.tsx
Outdated
Show resolved
Hide resolved
react-components/src/components/CacheProvider/AssetMappingAndNode3DCache.ts
Outdated
Show resolved
Hide resolved
…d-caching-many-asset-mappings
Type of change
Jira ticket 📘
https://cognitedata.atlassian.net/browse/BND3D-4199
https://cognitedata.atlassian.net/browse/
Description 📝
This fixes the rule threshold for large rule-based + 3d model content + asset mappings by changing the asset mapping cache system in react components and some refactoring to speed up the rule threshold applying onto the 3d models, including a loading indicator when the rule is processing, loading, and applying the styling.
Before this, the asset mapping cache was based on a list of asset IDs or node IDs that were requested at once. However, the asset IDs of the requests are not always the same, forcing the cache mechanism to request the mappings even for those cached already in a different list.
So now the cache key is based on the asset against all its mappings rather than a summed key based on a chunk of mappings.
This way it is possible to have more freedom and flexibility to use the cache without relying on a static list.
Test instructions ℹ️
1 - Open a 3D scene in Search UI that contains contextualized assets and rule based thresholds (recommend to test in a scene that contains a huge amount of geometries and asset mappings to see the changes like Celanese, for instance).
2 - Select an Rule Based Thresholds and switch to another rule.
3. Observe the loading indicator replacing the radio button while the rule is loading and the performance improvements compared with the previous version (not crashing after loaded, more stable).
Note: it is connected to the Fusion PR https://github.com/cognitedata/fusion/pull/7149 for working with the Rule Based loading indicator
Checklist ☑️