Virtual Table Scrolling Performance lag Issue with WebSocket real-time data updates
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend, performance
Hướng nghiên cứu
Bắt đầu bằng việc tái hiện bảng ảo và kiểm tra BodyGrid.tsx quanh các dòng 244-247, nơi được báo cáo rằng itemProps.style kích hoạt việc render lại các ô. Sử dụng React Profiler và các công cụ hiệu năng của trình duyệt khi kiểm thử các ô phức tạp và các cập nhật hàng qua WebSocket; được xem là hoàn thành khi xác định và xử lý được độ trễ khi cuộn mà không làm thoái lui hành vi cuộn ảo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 1.4k
- Fork
- 623
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react-component/table
-
feat: expose onVirtualScroll on VirtualTableCó thể đã có người làm @GarethJin đã nhận 44 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
react-component/table#1522 ·
-
Fixed-header tables force one getBoundingClientRect per column on every mount (ResizeObserver-driven MeasureCell)Có thể đã có người làm @rubenmarcus đã nhận 65 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
react-component/table#1507 ·
-
rowExpandable does not work when dataSource has children fieldCó thể đã có người làm @nrps9909 đã nhận 99 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
react-component/table#1416 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
react-component/table#1403 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
react-component/table#1269 · 1 bình luận ·
Tất cả issue của react-component/table
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Chocobozzz/PeerTube#7901 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
area:tools bug has repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
anthropics/claude-code#113984 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ehmpathy/declapract-typescript-ehmpathy#960 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Web UI: Pressing Ctrl+<key> with Caps Lock active triggers Ctrl+Shift+<key> shortcutsĐang mởarea/web platform/windows type/bug version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
anomalyco/opencode#68237 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100