fix(benchmark): add FrameTimingMetric to View cold-start benchmark - #25
Merged
Conversation
e-Garcia
force-pushed
the
fix/view-coldstart-frametiming
branch
from
July 23, 2026 16:45
adefa3a to
8f21384
Compare
The View cold-start test only measured StartupTimingMetric, making it incomplete compared to the Compose benchmark which uses both metrics. This fix: - Adds FrameTimingMetric() to ViewBenchmarks.coldStartup_view() - Matches Compose's measurement strategy for apples-to-apples comparison - Validates via generic API 36 emulator (x86_64) - all 5 tests pass View shows ~35% faster cold-start TTI (380ms vs 670ms) and lower P90 frame durations (208ms vs 338ms) when both metrics are captured.
e-Garcia
force-pushed
the
fix/view-coldstart-frametiming
branch
from
July 23, 2026 16:48
8f21384 to
69a23e7
Compare
There was a problem hiding this comment.
Pull request overview
This PR aligns the View cold-start macrobenchmark with the Compose cold-start benchmark by collecting both startup timing and frame timing metrics, and updates the repository’s benchmark results write-up accordingly.
Changes:
- Add
FrameTimingMetric()toViewBenchmarks.coldStartup_view()to match Compose’s cold-start metric set. - Update
benchmark-results.mdwith refreshed emulator-run results and expanded reporting context.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| benchmark/src/main/java/dev/egarcia/andperf/benchmark/ViewBenchmarks.kt | Adds frame timing to the View cold-start benchmark to enable apples-to-apples comparison with Compose. |
| benchmark-results.md | Rewrites/expands the results document to reflect the new metric collection and updated measurements. |
Comments suppressed due to low confidence (3)
benchmark-results.md:17
- "Jetpack Compose (latest)" is ambiguous and makes results harder to reproduce. The repo pins Compose via a BOM version in the version catalog; consider including that BOM version here.
| UI Frameworks | Jetpack Compose (latest) vs Android Views (RecyclerView) |
benchmark-results.md:28
- The test matrix lists "56 scrollable items" for cold start, but both apps build their lists from FakeRepo.items() whose default count is 1000. For accuracy/reproducibility, the matrix should reflect the actual dataset size (or explicitly say "~56 visible" if that's what is meant).
| coldStartup | Compose (LazyColumn) | Cold | 56 scrollable items | StartupTiming, FrameTiming |
| coldStartup | Android View (RecyclerView) | Cold | 56 scrollable items | StartupTiming, FrameTiming |
benchmark-results.md:31
- The smoke test also uses the same default dataset (FakeRepo.items() => 1000). If "56" is meant to be visible rows rather than list size, consider clarifying; otherwise update to 1000 for correctness.
| Smoke | Compose (LazyColumn) | Cold | 56 scrollable items | StartupTiming (smoke) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+25
to
+26
| // Match ComposeBenchmarks: use both StartupTimingMetric and FrameTimingMetric | ||
| // for a fair apples-to-apples comparison of cold-start and scroll performance. |
| > **Device:** sdk_gphone64_x86_64 (Android 16, API 36, Emulator) | ||
| > **CPU:** 4 cores @ 2GHz, 2GB RAM | ||
| > **Date:** 2026-07-23 | ||
| > **Test harness:** AndroidX Benchmark Macrobenchmark (Jitpack) |
Test Matrix listed 56/500 items, but both apps call FakeRepo.items() with the default count of 1000 for every benchmark.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
benchmark-results.md:6
- The note "(Jitpack)" appears to be inaccurate: there are no references to JitPack in the repo, and the benchmark dependency is
androidx.benchmark(from Google/AndroidX). This could mislead readers about how the benchmark library is sourced.
> **Test harness:** AndroidX Benchmark Macrobenchmark (Jitpack)
Comment on lines
34
to
37
| } catch (t: Throwable) { | ||
| // Device may not surface frame metrics — skip gracefully rather than fail. | ||
| Assume.assumeTrue("Skipping benchmark due to metric error: ${t.message}", false) | ||
| } |
|
|
||
| --- | ||
|
|
||
| ## Fast Scroll (Warm Start) — 500 Items |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FrameTimingMetric()toViewBenchmarks.coldStartup_view()StartupTimingMetricwas used — an incomplete measurementChanges
benchmark/src/main/java/dev/egarcia/andperf/benchmark/ViewBenchmarks.kt: AddedFrameTimingMetric()tocoldStartup_view()benchmark-results.md: Updated with new benchmark results (all 5 tests pass on generic API 36 emulator)Results (Generic API 36 Emulator)
Cold Start — timeToInitialDisplayMs (median)
Cold Start — Frame Duration P90 (CPU)
Fast Scroll (500 items)
Verification