The example's instrumentation runs optimized Hermes bytecode that imports
ThreadBenchmark from the public Nitro package. It also starts two native
SDK windows around SHA-256 on the Android main looper and a dedicated worker.
The main thread hashes 32 blocks of 256 KiB. CI chooses the worker block count.
Each result includes the digest so the runner can check the work independently.
Build the example and its instrumentation APK from this workspace with the Android SDK, JDK 17, Python 3 and Bun available:
corepack yarn install --immutable
cd apps/example-react-nitro
bun run prepare:nitro
cd android
./gradlew :app:assembleRelease :app:assembleReleaseAndroidTest -PreactNitroAbis=arm64-v8a -PreactNativeArchitectures=arm64-v8a
adb install -r app/build/outputs/apk/release/app-release.apk
adb install -r app/build/outputs/apk/androidTest/release/app-release-androidTest.apk
adb shell am instrument -w -r -e workerBlocks 32 \
com.example.perfkitexample.test/com.example.perfkitexample.BenchmarkInstrumentationA successful invocation returns INSTRUMENTATION_CODE: -1 and a JSON
benchmark record containing hermes, main, worker and actionElapsedMs.
The latter spans worker submission through completion of both native tasks.
The harness checks that the target is non-debuggable, Hermes runs on the main
looper, the worker TID differs, and windows reject cross-thread and repeated
ends. Use the same APK with workerBlocks 48 for 50% more worker input.
On a native ARM64 ADC Android 15 VM, 18 non-debuggable Release launches produced 54 windows with full PMU coverage. Increasing only the worker from 8 to 12 MiB changed its instructions by +49.94% and cycles by +49.60%. The main looper's instructions changed by +0.003% and cycles by +0.03%. These are median within-block changes over six blocks on one VM.