-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Fix workflow performance #27588
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
base: main
Are you sure you want to change the base?
Fix workflow performance #27588
Conversation
…and node dragging optimizations
…erformance optimizations
…nd improve drag position handling
…g position remains unchanged
|
/gemini review |
|
/gemini review |
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.
Code Review
This pull request introduces significant performance optimizations for the workflow component, which is great for handling large workflows. The use of viewport-based virtualization, throttling interactions with requestAnimationFrame, and optimizing CSS during drag operations are all excellent strategies. The implementation is well-executed, with careful handling of state and side effects. I have one suggestion in web/app/components/workflow/index.tsx to further optimize the new virtualization logic by refining the dependencies of a useEffect, which should prevent some unnecessary recalculations.
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.
Code Review
This pull request introduces significant performance improvements to the workflow component, primarily through viewport-based virtualization of nodes and edges, and by throttling expensive drag and mouse-move operations using requestAnimationFrame. The changes are well-structured and address performance from multiple angles, including CSS optimizations to reduce repaint costs during dragging. However, there is a critical issue in the implementation of multi-node dragging where the relative positions of selected nodes are not maintained, causing them to scatter. I've provided detailed comments on this issue in use-nodes-interactions.ts.
…ab/dify into fix-workflow-performance
|
/gemini review |
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.
Code Review
This pull request introduces significant performance optimizations for the workflow component, primarily through viewport-based virtualization, interaction throttling with requestAnimationFrame, and reducing repaint costs during drag operations. The changes are well-structured and use effective patterns for improving performance in a complex React application. My review includes two main points: one for improving code quality by removing a redundant check, and another to fix a high-severity issue where a memoization optimization was likely ineffective due toการเปรียบเทียบการอ้างอิงออบเจ็กต์ที่ไม่ถูกต้อง
…t checks for CUSTOM_NOTE_NODE
…ab/dify into fix-workflow-performance
Important
Fixes #<issue number>.Summary
fix #27586
• Key Changes
visibility via hidden flags for both nodes and edges as the user pans, zooms, or drags.
constraints, and dispatch helpline alignment only when movement occurs.
Problem Solved
Reference
Screenshots
大量节点性能问题 (1).yml
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods