Android: snapshots ~10× slower while a looping Reanimated opacity animation is on screen (follow-up to #3558)
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
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- android, react-native, typescript
- Lĩnh vực
- mobile-dev, performance
Hướng nghiên cứu
Start by reading the Android snapshot implementation and the cache-miss handling on the UI thread; the issue does not name specific source files or tests. Compare repeated captures with the opacity loop running and held still, using the provided setup and measurements. Done means identifying and addressing the animation-related snapshot latency while keeping captures successful and including the sheet root.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-up to #3558, split out as asked. #3611 (0.21.28) fixed the missing-window capture failure. This issue tracks the remaining latency: Android snapshots are about 10× slower while one small looping animation is on screen.
Setup
- Screen: a full-height
@lodev09/react-native-true-sheet4.0.0-beta.24 sheet (on Android, a separate dialog window). Its header holds an 8×8Animated.Viewwhose opacity loops forever with Reanimated 4.5.4:withRepeat(withSequence(withTiming(0.4, 800 ms), withTiming(1, 800 ms)), -1). - React Native 0.86.3 (New Architecture), Expo SDK 57, release build.
- Emulator
sdk_gphone64_arm64, Android 16 (API 36), 1080×2400. Host: Apple M5 Max, macOS, shared with other emulators and builds. - "Animations off" means
window_animation_scale,transition_animation_scaleandanimator_duration_scaleset to0before launch. Reanimated reads that as Reduce Motion and holds the dot still. Nothing else on screen changes.
0.21.28, 2026-10-17 (the table requested in #3558)
Same session, same sheet. Host load average was 170–240 for both rounds.
| Device animations | Snapshot wall time | Sheet root in snapshot |
|---|---|---|
| On (2 rounds) | 4.3–15.1 s | 12/12 |
| Off (Reanimated holds the dot still) | 0.3–0.5 s | 6/6 |
On the slow captures, the daemon's durationMs matched the wall time (4.1–5.3 s on the ones checked).
0.21.28 vs 0.21.29-nightly.20261019.75 (includes #3790), 2026-10-19
Same app build, same emulator, one session. Each block is 7 snapshot --json calls; the first call is dropped because it reinstalls the shared helper APK. Blocks run in ABAB order. The numbers are the helper's data.androidSnapshot.elapsedMs. Every capture succeeded and contained the sheet root.
| Device animations | Host load | 0.21.28 median (range) | nightly median (range) |
|---|---|---|---|
| On | 29–41 | 676 ms (535–1246) | 536 ms (301–681) |
| On | 16–27 | 443 ms (263–1140) | 439 ms (302–6664, 1 outlier) |
| Off | 17–24 | 164 ms (151–232) | 40 ms (39–46) |
What this shows on our screen:
- #3790 makes the static capture about 4× faster (164 → 40 ms).
- With the loop running, it changes little at moderate load: 676 → 536 ms at load 29–41, and 443 → 439 ms at load 16–27.
- The loop's cost on the nightly is about 11× (40 ms → 440–540 ms), with an occasional multi-second capture (6.7 s once, as load rose).
- Host load scales the slowdown. The same 0.21.28 measured about 0.5–1.2 s here and 4–15 s at load 170–240.
So the remaining cost seems to come from the animation itself rather than traversal order. That fits your note that Android serves cache misses on the UI thread, which a running animation keeps busy.
Impact and workaround
Anything that snapshots repeatedly (wait, press after a settle, replays) pays this on every capture while a pulsing "live" indicator is on screen. That's common in timers, workouts and live-status UIs. Our workaround is animation scales at 0 on the test emulator, as Espresso suites do. That isn't available when the animation is the thing under test.
Happy to run a build against this screen. I can attach the request logs (requests/*.ndjson) for any of the runs above, or put together a minimal repro app (one TrueSheet sheet with the withRepeat opacity loop).
- Ngôn ngữ chính
- TypeScript
- Star
- 5k
- Fork
- 334
- Merge trung bình
- 12 giờ 13 phút
- Pull request đã merge (30 ngày)
- 723
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 callstack/agent-device
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
callstack/agent-device#3819 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS helper audio-probe always reports -90 dBFS: AVAudioPCMBuffer frameLength set after the copyCó thể đã có người làm @jipeng6036-del đã nhận hôm nay. Đang mởbug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
callstack/agent-device#3771 · 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 68/100
callstack/agent-device#1869 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android smoke: first fixture capture stalls before any readable snapshotCó thể đã có người làm @thymikee đã nhận hôm nay. Đang mởbug needs-triage
callstack/agent-device#3831 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 15/100
callstack/agent-device#3808 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của callstack/agent-device
Issue tương tự
-
Edit: Travel Mix (RO)Đang mởcheck:failed streams:edit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
iptv-org/iptv#55901 · 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 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
package:ios ships XCFrameworks with absolute symlinks, which SwiftPM refuses to extractCó thể đã có người làm @cusnirvladislav đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
callstackincubator/rock#740 ·
-
S: triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
RED ladder stopped @ 4db4ed91Đang mởarea:workflow bug ready-for-human
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
fil-donadoni/tolaria#6108 ·
Maintainer thường phản hồi trong vòng 1 ngày