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

perf: avoid unnecessary transform updates to improve performance #6619

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

Aarebecca
Copy link
Contributor

@Aarebecca Aarebecca commented Dec 10, 2024

  • 减少多余的 transform 更新以提升性能
  • 避免使用 G 样式设置 API 以优化性能

对于大部分 G6 样式,直接拷贝至内置 attributes 对象性能会比 setAttribute API 更好

优化结果:(以 perf20000Elements 用例为基准)
首屏渲染时长
优化前:930 ms
优化后:900 ms
提升约:3.2%

@Aarebecca Aarebecca force-pushed the perf/optimize-element-perf branch 2 times, most recently from 5bf7c9c to c1945e8 Compare December 10, 2024 07:20
@Aarebecca Aarebecca force-pushed the perf/optimize-element-perf branch from c1945e8 to 5818bc7 Compare December 11, 2024 02:08
@Aarebecca Aarebecca merged commit 345eb80 into v5 Dec 13, 2024
2 checks passed
@Aarebecca Aarebecca deleted the perf/optimize-element-perf branch December 13, 2024 02:14
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.

1 participant