Skip to content

test(performance): compare Android Release builds on ADC and AWS Device Farm - #750

Draft
hannojg wants to merge 9 commits into
mainfrom
hannojg/adc-performance-poc
Draft

hannojg wants to merge 9 commits into
mainfrom
hannojg/adc-performance-poc

Conversation

@hannojg

@hannojg hannojg commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Our Android Harness tests check correctness. This adds an opt-in CI comparison between two Release builds. Both APKs embed the same benchmark, run on the same ADC device and take turns going first. The app times MMKV reads and React commits. The Callstack SDK records process CPU time and memory. CI saves the measurements and reports the intervals.

I calibrated it with identical code and a candidate doing 10.16% more MMKV reads. The runner checked both timing intervals at nine predefined points and stopped when their radii reached five percentage points.

Device Identical code Extra MMKV reads MMKV time change with extra reads
ADC, ARM64 Android 15 256 pairs in 16 min 46 s 192 pairs in 12 min 50 s +7.45% [+2.90%, +12.22%]
Galaxy S25 Ultra, unmetered AWS Device Farm 32 pairs in 1 min 21 s 20 pairs in 51 s +9.10% [+7.58%, +13.12%]

One pair is two measured app starts. The Galaxy cleared the proposed +5% regression threshold. Its full Device Farm job took 5 min 17 s.

The manual hardware-counter mode runs 64 pairs and measures cycles and retired instructions on the Hermes thread. With 10.16% more MMKV reads, it measured 10.55% more cycles [+9.37%, +13.14%] and 10.1561% more instructions. The elapsed-time interval for the same launches was −2.27% to +23.41%. With identical code, the cycle interval was −1.39% to +1.28%.

Across both workloads, instruction counts reached the five-point precision target after 24 pairs (about 2 min 14 s), and cycles after 64 pairs (about 5 min 30 s), in a separate replay correcting for multiple looks. Both counter runs used fresh leases on the same native ARM64 ADC VM. The performance check is advisory. Measurement details and run commands

The harness now uses the published PerfKit 0.2.1 ThreadBenchmark API. Both Release APKs ran on native ARM64 ADC with the SDK from npm and GitHub Packages. All 16 MMKV and render windows from four positive-control pairs had full counter coverage. The calibration above was collected with the original prototype.

The follow-ups add reviewed fork runs in #773 and renderer, text input and scroll benchmarks in #774.

@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nitro-ui-docs Ready Ready Preview Dec 3, 2026 3:36pm UTC
react-nitro-docs Ready Ready Preview Dec 3, 2026 3:36pm UTC

Request Review

@hannojg hannojg changed the title test(performance): compare Android Release benchmarks on ADC test(performance): compare Android Release builds on ADC and AWS Device Farm Nov 30, 2026
hannojg added a commit to callstackincubator/performance-analytics that referenced this pull request Nov 30, 2026
This exposes the same per-thread measurement used in the [React Nitro
release benchmark](margelo/nitro-ui#750)
through the native Android SDK, with the same named-window API for React
Native and React Nitro on Android and iOS. A harness can open a named
window on any app thread and return its measurements directly to CI.

```ts
const window = new ThreadBenchmark('read-items');
readItems();
const result = window.end();
```

The calling thread owns the window. Ending it returns its OS thread ID,
elapsed time and thread CPU time. On Android it also returns raw retired
instructions and CPU cycles when the device permits access. The perf
group opens only on explicit construction. CI gets availability, enabled
time and running time for every group reading. Both JS adapters use the
native SDK of their platform.

## Android Release validation

The example instrumentation ran optimized Hermes bytecode on the main
looper and hashed fixed SHA-256 blocks through the native SDK on the
main looper and a worker. For example, Hermes and the native main window
reported TID 6001 and the worker reported 6016. Ending a window on the
other thread failed and the owner could still finish it.

One native ARM64 ADC VM ran Android 15 with `armv8_pmuv3_0`, native
bridge disabled and a non-debuggable target. Each block had two
identical 8 MiB worker runs and one 12 MiB worker run. The main workload
stayed at 8 MiB. Six blocks covered all six launch orders. The table
shows median within-block changes relative to the first labeled 8 MiB
control. All 54 windows had positive, equal enabled and running times.
Both SHA-256 digests were independently verified on the host.

| Window | A/A instructions | A/A cycles | Extra worker input,
instructions | Extra worker input, cycles |
| --- | ---: | ---: | ---: | ---: |
| Hermes | +0.002% | +0.03% | -0.001% | +0.08% |
| Main looper | +0.000% | -0.07% | +0.003% | +0.03% |
| Worker | +0.003% | -0.07% | +49.939% | +49.60% |

The JSON result also includes the monotonic duration from dispatch
through completion of both native tasks. The example README includes the
build and CI invocation. This draft targets Android artifact `0.2.0` for
the next adapter release.

## React Native and iOS Release validation

The React Native example ran without analytics setup on a native ARM64
Android 15 ADC VM. The checksum window reported 38,033,726 instructions
and 17,502,998 cycles. The returned TID (5817) matched the OS thread
named `mqt_v_js`. Enabled and running time were both 7,391,960 ns.

On an iPhone 17e simulator running iOS 27.0, both Release apps returned
the following results for the same checksum. These single observations
verify the bindings.

| Adapter | Darwin TID | Elapsed | Thread CPU |
| --- | ---: | ---: | ---: |
| React Native | 23184818 | 8.387 ms | 8.380 ms |
| React Nitro | 23215891 | 5.864 ms | 5.862 ms |

The iOS in-app result reports `countersAvailable: false` and `ENOTSUP`.
A separate XCTest performance case requests CPU cycles and retired
instructions using Apple’s thread-scoped `XCTCPUMetric`. CI can read
available metrics from the xcresult bundle. This simulator returned only
the clock metric. The Swift owner-thread and repeated-end assertions
passed.
@hannojg hannojg added area: testing Test infrastructure and CI performance Performance improvements, profiling, and benchmarks triage: ai triaged AI classification is complete labels Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: testing Test infrastructure and CI performance Performance improvements, profiling, and benchmarks triage: ai triaged AI classification is complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant