[RUM] The Logs page is 2% of views but 31% of >500ms main-thread frames — a non-virtualized, index-keyed table re-renders every row per live flush
Maintainer thường phản hồi trong vòng 1 ngày
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
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend, performance
Hướng nghiên cứu
Start with src/features/instance/log/LogsDataTable.tsx, then read src/features/instance/log/hooks/mergeReadLogs.ts and src/features/instance/log/hooks/useInstanceLogs.ts to trace row identity and update frequency. Check the table's row keys and rendering behavior with live log updates, then investigate TanStack virtualization. Done means the table keeps updates responsive at the stated log limits and production RUM blocking time improves after release.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The instance Logs page (/<org>/<cluster>/logs and …/instance/<id>/logs) is Studio's worst main-thread hotspot in production RUM. It is about 2% of production views but produces 31% of all long-animation frames with more than 500ms of blocking time. Single frames reach 10–20s of blocking, so the tab freezes.
Datadog RUM findings (production fabric.harper.fast, last 15 days)
Long-task data only goes back ~15 days, so there is no older baseline. This is a measured hotspot, not a proven regression.
| Logs views | Every other view | |
|---|---|---|
| Views | 140 | 7,120 |
Frames with >500ms blocking (@long_task.blocking_duration) |
122 | 272 |
| Sessions with such a frame | 17 of 80 Logs sessions (21%) | — |
- Logs-view p95
blocking_duration: 808ms over 2026-10-26 → 11-09. 3,026ms in the 24h ending 2026-11-10, but that window had only 2 sessions. - Daily heavy-frame counts on Logs are bursty: 2 / 5 / 3 / 0 / 0 / 0 / 0 / 42 / 0 / 33 / 3 / 0 / 0 / 34 (10-26 → 11-10). Each burst comes from a long-open Logs tab.
- Attribution of frames where
scripts[]names exactly one host, as in #1684:- Studio's own bundle: 35 frames, 14 sessions, 78.8s total blocking. Mostly
vendor-tanstack-*.js(@tanstack/query-corenotifyManagerin the dev file names) andvendor-react-*.js. On every other view, Studio's own bundle never produces more than 3 such frames per view. www.redditstatic.com/ads/pixel.js(loaded by GTM): 52 frames, 4 sessions, 60.5s. In 15 days, every heavy Reddit-pixel frame landed on the Logs view and none on any other view. The pixel is not slow in general. Something about this page makes it slow.- Multi-host frames of 10–20s that mix
fbevents.js,gtm.js,vendor-datadog,vendor-reactandvendor-tanstack.
- Studio's own bundle: 35 frames, 14 sessions, 78.8s total blocking. Mostly
Likely cause (hypothesis, not yet verified in a browser)
LogsDataTable renders every entry (default limit 1,000, live retention up to max(2000, limit) in useInstanceLogs) into a table that is not virtualized. useTable gets no getRowId, so row ids, and therefore React keys, are array indexes.
mergeReadLogs returns the list newest-first. Each new line is prepended, which shifts every index. React then rewrites the text of every cell in every row, not just the new one. The SSE tail does this up to every 250ms (FLUSH_INTERVAL_MS), and the polling fallback every 5s.
That explains both signals:
- Studio's own cost: reconciling and committing about 1–2k rows × N cells per flush.
- The third-party cost: whole-table DOM churn feeds every
MutationObserver/DOM-scanning tag that GTM injects (Reddit pixel, Facebook). That would explain why the Reddit pixel only blocks here.
Suggested fix
- Pass
getRowIdtouseTable, built from the identitymergeReadLogsalready computes (logKey). A prepend then mounts only the new rows and leaves existing DOM nodes untouched. - Virtualize the table body, e.g.
@tanstack/react-virtual, which fits the TanStack Table that is already in use. This bounds DOM size whatever the limit. - Re-measure Logs-view
blocking_durationp95 and heavy-frame share after the fix ships. The Reddit-pixel frames should disappear as well if the hypothesis holds.
Related: #1684 (marketing tags on /sign-in), #1762 (Reo double-load).
Reproduce the numbers
pup rum aggregate --query "@application.id:<studio> @type:long_task @view.url_host:fabric.harper.fast @view.url_hash:*logs @long_task.blocking_duration:>500000000" --compute count --from 15d --to now
pup rum events --query "… same, without the view filter" --from 30d --to now --limit 5000 # then group by single-host scripts[].source_url
🤖 Generated by Claude Code (Claude Opus 5.5); posted via @dawsontoth.
- Ngôn ngữ chính
- TypeScript
- Star
- 5
- Fork
- 4
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 60
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 HarperFast/studio
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
HarperFast/studio#2111 ·
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 82/100
HarperFast/studio#2109 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
rum
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
HarperFast/studio#2085 ·
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 78/100
HarperFast/studio#2070 ·
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 74/100
HarperFast/studio#2067 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của HarperFast/studio
Issue tương tự
-
area: batch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
inabagumi/shinju-date#7294 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
streaming-video-technology-alliance/common-media-library#700 ·
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 82/100
vercel-labs/ui#809 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
KrisCris/village-in-the-shade-guide#75 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bot:ai-assisted component:platform-js status:untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
midnightntwrk/platform-js#38 ·