Skip to content
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

feat(elements): support control whether to execute draw methods #5874

Merged
merged 10 commits into from
Jun 18, 2024

Conversation

Aarebecca
Copy link
Contributor

  • 实现 effect 装饰器,用于控制依赖更新

效果对比:

图规模:34 个节点、60 条边

  1. 入场绘制(启用动画)

优化前:
执行 keyShape 绘制 1W+ 次

image

优化后:
执行 keyShape 绘制 2k+ 次
image

  1. 交互

优化前:
拖拽元素过程中执行子图形重绘

优化后:
跳过子图形重绘


  • Implement the effect decorator to control dependency updates

Comparison:

Graph size: 34 nodes, 60 edges

  1. Entrance drawing (animation enabled)

Before optimization:
Perform 1W+ keyShape draws

image

After optimization:
Perform 2k+ keyShape draws
image

Interaction

Before optimization:
Performs a child redraw while dragging an element

After optimization:
Skip the child graphics redraw

Discussion: #5511

@Aarebecca Aarebecca merged commit 0860603 into v5 Jun 18, 2024
5 checks passed
@Aarebecca Aarebecca deleted the refactor/optimize-element branch June 18, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants