antvis/G6

[V5] Performance Issue - Multiple selection is delayed when rendering large number of nodes #6143

hongwei0417 posted onGitHub

Describe the bug / 问题描述

When rendering 1000 nodes and select multiple nodes There will be a delay of a few seconds before the node status changes (as below)

I found that the bottleneck may be caused by updateNodeData(), which will compare the data changes of each node, for reference. https://github.com/antvis/G6/blob/7ce727aacd7ee9df434cdb6fd62da20f717ffebc/packages/g6/src/runtime/data.ts#L425

Arc_lch4RIUAdV

No response

Steps to Reproduce the Bug or Issue / 重现步骤

  1. Render more than 1000 natvie nodes
  2. Enable click-select behavior
  3. Click and select multiple nodes

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

macOS, Windows

Browser / 浏览器

Chrome, Edge, Others / 其他

Additional context / 补充说明

No response


Thanks for the feedback, we will optimize for this situation

posted by Aarebecca 9 months ago

In the latest version(5.0.18), updating 1000 nodes and 999 edges to the selected state takes about 150ms, and to the default state takes about 80ms. It is acceptable at present, and we will continue to optimize the performance in the future.

You can see the performance test report as follow: https://github.com/antvis/G6/blob/f576afc6e096f2035481c3f05ab4bd549dcc3f5d/packages/g6/__tests__/perf-report/9821ed36_2024-08-29_13%3A24%3A51.json#L28-L57

Sep-02-2024 15-10-20

posted by Aarebecca 8 months ago

Fund this Issue

$0.00
Funded

Pull requests