[Benchmark, reference only] Robolectric vs Compose Desktop preview screenshot tests - #903
Conversation
|
Closing as intended: this is a reference-only benchmark (setup + results + reproduction steps), not for merging. See the PR description for the numbers. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe sample now contains 30 benchmark Compose previews and supports generating and benchmarking preview screenshot tests through both Robolectric and Compose Desktop/JVM targets. ChangesMultiplatform preview benchmarks
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Gradle
participant PreviewGenerator
participant BenchmarkPreviews
participant ScreenshotTasks
Gradle->>PreviewGenerator: enable Robolectric and Desktop preview generation
PreviewGenerator->>BenchmarkPreviews: scan numbered `@Preview` composables
PreviewGenerator->>ScreenshotTasks: generate recording tests
ScreenshotTasks->>BenchmarkPreviews: render preview content
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |




























































What
Reference benchmark setup and results comparing the Robolectric preview tests (latest beta) against the new Compose Desktop preview tests, on 30 identical
commonMainpreviews insample-generate-preview-tests-multiplatform(both generators enabled withseparateOutputDirs, Robolectric forced to 4.17-beta-2).This PR is intentionally closed without merging — it exists so the numbers and setup are reproducible when we need comparison evidence (docs, release notes, discussions).
Results
gradle-profiler 0.24.0, 2 warm-ups + 6 measured iterations each, warm daemon, configuration cache on,
pixelCopyRenderMode=hardware, defaultsdk=[33]/ Pixel4a qualifiers, Apple Silicon macOS:→ ~3.8x faster end-to-end for 30 previews; the per-preview steady state is ~6x, so the gap widens as suites grow.
Output fidelity notes
Both sides wrap to preview content (no window-sized captures). The images are not cross-comparable:
ComposeUiTestdefault) — exactly 2.75x height differencePer-platform goldens (via
separateOutputDirs) are the intended workflow. The density gap could be closed later by applying preview parameters to the desktop capture (proposals/02 future work).Reproduce
Summary by CodeRabbit
New Features
Tests