[Bug]: 动画开销增加快于预期,在中小规模的图(300个节点)中就会导致3秒卡顿
Author: thislightCreated Jul 8, 2026Updated Jul 8, 2026
Labelswaiting for maintainer
Describe the bug / 问题描述
随着节点、边的数量增加,动画的性能开销增加快于预期。在导入300个节点的情况下,动画系统可以导致近3秒的Jank。
查询Issues之后,发现最近也有数个状况相似、跟渲染性能有关的Issue:#7664 #7402 #7574 。但是由于信息不足,不知道是否与该问题有关。
运行环境:
- Firefox 152
- Fedora 42, Intel Core i7-13620H
$ pnpm why @antv/g6
@antv/[email protected]
├─┬ @antv/[email protected]
│ └── [email protected] (dependencies)
└── [email protected] (dependencies)Reproduction link / 复现链接
Steps to Reproduce the Bug or Issue / 重现步骤
- 使用的图配置可参考复现链接,部分参数有修改。
- 导入节点300个、边313条,0个combo,调用
Graph.render出现长时间Jank - 分别使用Firefox Profiler抓取动画启用和未启用的情况
- 在开发包下,动画启用后出现了长时间Jank(
~3.9s,相对于未启用动画时~500ms),包含大量的requestAnimationFrame回调(总时间77%),其中的Animation.updatePromises占据了总时间58%,其子帧只占据总时间~12.5%。(Profiler信息截图:Profile-动画.png,Profile-无动画.png)
Version / 版本
5.x
OS / 操作系统
- macOS
- Windows
- Linux
- Others / 其他
Browser / 浏览器
- Chrome
- Edge
- Firefox
- Safari (Limited support / 有限支持)
- IE (Nonsupport / 不支持)
- Others / 其他
Source: antvis/G6