-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Move asset selection filtering to webworker #26315
Conversation
// Returns `false` if `filterArray` is non-empty and `valueArray` is empty (no matches possible). | ||
// Otherwise, checks if all elements in `filterArray` have at least one corresponding match in `valueArray`. | ||
// Uses `Array.prototype.some()` to verify if any `filterArray` element lacks a match and returns `false` in such cases. | ||
export function doesFilterArrayMatchValueArray<T, V>( |
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.
Moved this to a separate file so that the webworker doesnt end up pulling React.
@@ -94,23 +93,6 @@ export function useTagsForObjects<T>( | |||
); | |||
} | |||
|
|||
export function doesFilterArrayMatchValueArray<T, V>( |
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.
Moved this to a separate file so that the webworker doesnt end up pulling React.
Deploy preview for dagit-core-storybook ready! ✅ Preview Built with commit 057a43d. |
…perf-improvements
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.
This looks great! Just left a few inline comments
@@ -225,7 +225,7 @@ export const AssetsCatalogTable = ({ | |||
|
|||
const refreshState = useRefreshAtInterval({ | |||
refresh: query, | |||
intervalMs: FIFTEEN_SECONDS, | |||
intervalMs: 4 * FIFTEEN_SECONDS, |
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.
This seems fairly impactful, are we ok with backing this off so much? It should already be slowing down if refresh
takes a while, there's some fanciness inside this hook
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.
This still fires immediately if they leave tabs and come back or hit the refresh button in the top right corner.
js_modules/dagster-ui/packages/ui-core/src/asset-graph/ComputeGraphData.worker.ts
Show resolved
Hide resolved
localStorage.setItem(DAGSTER_FLAGS_KEY, JSON.stringify(flags)); | ||
if (broadcast) { | ||
featureFlagsChannel.postMessage('updated'); | ||
if (typeof localStorage !== 'undefined') { |
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.
Might be nice to call out that this is for the webworker case just so we don't forget 😬
js_modules/dagster-ui/packages/ui-core/src/asset-graph/useAssetGraphData.tsx
Outdated
Show resolved
Hide resolved
fd82ec0
to
16de3e2
Compare
js_modules/dagster-ui/packages/ui-core/src/util/generateObjectHash.ts
Outdated
Show resolved
Hide resolved
js_modules/dagster-ui/packages/ui-core/src/asset-graph/useAssetGraphData.tsx
Show resolved
Hide resolved
31f8f50
to
28b99af
Compare
Move our heavy asset selection filtering to a webworker. Added a feature flag as an escape hatch. Tested primarily with cloud-proxy with customers that have large graphs.
Similar to #26315, moves `buildGraphData` for the `useFullAssetGraphData` hook into a webworker. ## Test plan Tested using app-proxy and loading a big asset graph
## Summary & Motivation Move our heavy asset selection filtering to a webworker. Added a feature flag as an escape hatch. ## How I Tested These Changes Tested primarily with cloud-proxy with customers that have large graphs.
Similar to dagster-io#26315, moves `buildGraphData` for the `useFullAssetGraphData` hook into a webworker. ## Test plan Tested using app-proxy and loading a big asset graph
Summary & Motivation
Move our heavy asset selection filtering to a webworker. Added a feature flag as an escape hatch.
How I Tested These Changes
Tested primarily with cloud-proxy with customers that have large graphs.