Virtual Table Scrolling Performance lag Issue with WebSocket real-time data updates
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 28/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react, typescript
- 領域
- frontend, performance
調査の方向性
仮想テーブルの再現から始め、244-247行付近の BodyGrid.tsx を調査してください。そこでは itemProps.style がセルの再レンダリングを引き起こすと報告されています。複雑なセルと WebSocket による行の更新をテストしながら、React Profiler とブラウザーのパフォーマンスツールを使用してください。スクロールの遅延を特定して対処し、仮想スクロールの動作を後退させていなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Reproduction link
https://ant.design/components/table#table-demo-virtual-list
Steps to reproduce
- Create a virtual table using rc-table's genVirtualTable
- Implement with complex cell nodes
- Load initial data with WebSocket real-time updates for certain rows
- Scroll the table vertically
What is expected?
Smooth vertical scrolling performance with virtual list implementation.
What is actually happening?
Implementation Details
import { genVirtualTable } from 'rc-table';
const RcVirtualTable = genVirtualTable(
(prev, next) => {
const { _renderTimes: prevRenderTimes } = prev;
const { _renderTimes: nextRenderTimes } = next;
return prevRenderTimes !== nextRenderTimes;
}
);
export default RcVirtualTable;
// Table
const Table = (props, ref) => {
const renderTimesRef = React.useRef<number>(0);
renderTimesRef.current = 1;
const virtualProps = { ref, _renderTimes: renderTimesRef.current };
return <RcVirtualTable {...props} {...virtualProps} />;
};
export default React.forwardRef(Table);
Actual Behavior
- Noticeable lag during vertical scrolling
- Using React Profiler with highlight feature shows:
- All rows re-render on each scroll with color yellow
- All cells re-render on each scroll with color yellow
This issue exists in both antd and rc-virtual-list demos
Investigation Findings
- Root cause of cell re-renders:
- Located in BodyGrid component
- Issue traced to: https://github.com/react-component/table/blob/master/src/VirtualTable/BodyGrid.tsx#L244-L247
- itemProps.style causing unnecessary re-renders even when not needed
- Additional observations:
- Commenting out the style prop prevents cell re-renders but scrolling lag persists
- Frame rate remains stable during scrolling
- Suggests possible CSS updates, reflow, or repaint issues
Potential Contributing Factors
- Complex cell node structure
- Subsequent WebSocket updates for specific rows
| Environment | Info |
|---|---|
| antd | 5.21.6 |
| React | 18.2.0 |
| System | macOS 14.6.1 |
| Browser | Chrome 130.0.6723.92 |
- Issue persists across React 16 and React 18
- Frame rate stability during lag suggests DOM operations (reflow/repaint) may be the bottleneck rather than React rendering
- Current implementation follows antd usage patterns with rc-table's genVirtualTable
- 主要言語
- TypeScript
- スター
- 1.4k
- フォーク
- 623
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react-component/table のほかの issue
-
feat: expose onVirtualScroll on VirtualTable対応中かも @GarethJin が 44 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
react-component/table#1522 ·
-
Fixed-header tables force one getBoundingClientRect per column on every mount (ResizeObserver-driven MeasureCell)対応中かも @rubenmarcus が 65 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
react-component/table#1507 ·
-
rowExpandable does not work when dataSource has children field対応中かも @nrps9909 が 99 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
react-component/table#1416 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
react-component/table#1403 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
react-component/table#1269 · コメント 1 件 ·
react-component/table の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Chocobozzz/PeerTube#7901 ·
メンテナーはふだん 3 日以内に返信
-
area:tools bug has repro
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
anthropics/claude-code#113984 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ehmpathy/declapract-typescript-ehmpathy#960 ·
メンテナーはふだん 1 日以内に返信
-
area/web platform/windows type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
anomalyco/opencode#68237 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100