diff --git a/.github/PERFORMANCE.md b/.github/PERFORMANCE.md new file mode 100644 index 0000000000..53a6182e3c --- /dev/null +++ b/.github/PERFORMANCE.md @@ -0,0 +1,95 @@ +# Release performance CI + +`Nitro Performance` builds `apps/benchmark` in its ordinary Release/Hermes configuration, +then runs base → head → head → base on one booted target. A noisy comparison can +run one additional head/base pair. Each suite measures 40 cases with five warmup +batches and twenty samples, calibrated toward 150 ms (roughly 100–200 ms) of +timed work per sample. Iteration counts are rounded to two significant digits +and frozen after warmup; measured outliers are retained. Allocation-heavy samples +sum bounded timed chunks with explicit GC and native-cleanup yields between chunks excluded from timing, +so memory-safety limits do not shorten the sample. See `iterations` and +`chunkIterations` in raw results; sample milliseconds are `ns/op * iterations / 1e6`. +Calibration changes and version-2 benchmark definitions require a new baseline. +Each binary is installed once per suite run. Each case uses a fresh app process +so the runtime-scoped JSI reference cache does not accumulate millions of weak +reference records across unrelated cases. Startup is outside measured work; +the host validates and combines the per-case results, preserving their raw samples. +The host computes confidence intervals by resampling whole matched base/head +process runs, then batches within each selected run. Bencher median bounds use +the same run-aware approach. Treating all batches from multiple processes as +independent gave a false-positive control result in the initial A/A validation; +process-level variability must be preserved in the uncertainty estimate. +Robust CV remains visible and causes a neutral result when uncertainty overlaps +zero. It is not an unconditional veto: an effect beyond the budget whose full +run-aware confidence interval excludes zero is still reported in its direction. + +The benchmark app is separate from `apps/example`, which keeps the demos and +Harness correctness tests. It shares the real Nitro test packages, but has no +Harness, navigation, screens, or safe-area dependencies. The TurboModule control +and all benchmark cases belong to the benchmark app. Android permits +cleartext only to loopback; the example app does not contain the CI entrypoint. +See [`apps/benchmark/README.md`](../apps/benchmark/README.md) for local commands. + +## Android host requirements + +The API 36 x86_64 emulator **must use KVM CPU acceleration**. The workflow grants +the ephemeral runner access to `/dev/kvm`, verifies acceleration before boot, and +launches with `-accel on`. Missing acceleration fails the job rather than silently +falling back to software CPU emulation. Software GPU rendering is separate and is +still used on the headless runner. + +The initial bootstrap run accidentally used `-accel off`: boot alone took 8½ +minutes and six suites took another 32½ minutes. Those Android timings are not a +performance baseline. Accelerated results use a distinct `...-kvm` Bencher testbed. + +Host-side log lines show each suite's start, completion, measurement duration, +total wall time (including app installation/launch), and why a repeat pair ran. +These logs are outside the app's timed regions. Raw JSON, BMF, and comparison +Markdown are retained in the workflow artifacts for 30 days. +Both targets have a five-minute boot limit; individual device installation and +launch commands have a two-minute limit. Android app exits also retain logcat and +process-exit diagnostics, so native crashes do not disappear at emulator teardown. + +Same-repository PRs publish from a separate clean job after both device jobs +finish. This works before merge: it checks out an immutable, reviewed reporting +commit, downloads only result data, validates it against GitHub API metadata, +and rebuilds the table/BMF without installing or executing either app checkout. +Fork PRs never enter this privileged job; their `workflow_run` reporter becomes +active once its definition reaches the default branch. That reporter skips +same-repository PRs to avoid duplicate uploads. Both paths post the rebuilt +paired-comparison table as one updatable PR comment, independently of Bencher's +historical comparison. Stale results do +not overwrite a newer PR revision, and user-authored comments are never edited. +Revoke the previously exposed credential and replace the +repository's `BENCHER_KEY` secret before enabling publishing. PR jobs never receive +that secret in device/build jobs or any fork job. After rotation, set the repository variable `NITRO_BENCHER_ENABLED` +to `true` to enable Bencher uploads. The paired PR comment does not need that key. +Verdicts remain advisory during noise calibration. + +The pre-merge publisher requires a real base benchmark app. The infrastructure +PR's bootstrap A/A runs remain diagnostic artifacts, not Bencher baselines. +For paired PR reports, first upload the measured base to `baseline-` +on each testbed, then upload `pr-` with that exact baseline as its start +point. This works with an empty Bencher project and with stacked PRs without +pretending their base is `main`. Pushes/scheduled main runs record main history. +Both platform baselines are uploaded before either head. The publisher does not +reset the PR branch for each platform, preserving the other testbed's reports; +a changed base SHA naturally selects a different start point. +The Bencher action and downloaded CLI version are both pinned. Both publishers +verify the reviewed Linux CLI SHA-256 before the step receiving the API key. + +## Promoting performance verdicts to a gate + +This initial workflow always passes `--mode advisory`; merging it does **not** +enable performance enforcement. Collect at least 30 successful main/no-change +runs on each unchanged suite and testbed before a separate reviewed promotion. +Use only same-commit comparisons to estimate noise; ordinary base/head deltas +may include real code changes and must not inflate the noise allowance. + +For each synchronous case, the promotion must set a per-case budget of +`max(5%, 1.5 × p95(abs(no-change delta)))`. Cases requiring over 10%, Promise +metrics, and inconclusive comparisons remain advisory. The current 5% table +threshold is provisional, not a calibrated gate. Do not simply change `--mode` +to `enforce`: the initial comparator uses that single provisional threshold, and +the trusted reporter deliberately rejects PR attempts to enable enforcement. +Promotion needs the reviewed per-case policy and matching reporter support. diff --git a/.github/workflows/performance-report.yml b/.github/workflows/performance-report.yml new file mode 100644 index 0000000000..d03d6950e8 --- /dev/null +++ b/.github/workflows/performance-report.yml @@ -0,0 +1,85 @@ +name: Publish Nitro Performance + +on: + workflow_run: + workflows: [Nitro Performance] + types: [completed] + +permissions: + actions: read + checks: write + contents: read + pull-requests: write + +jobs: + publish: + # Same-repository PRs publish in a separate job of Nitro Performance, which + # also works before this workflow reaches the default branch. + if: >- + github.event.workflow_run.event != 'pull_request' || + github.event.workflow_run.head_repository.full_name != github.repository + runs-on: ubuntu-24.04 + steps: + - name: Checkout trusted reporting code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 + with: + bun-version: 1.3.14 + + - name: Download performance report + id: download + continue-on-error: true + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 + with: + name: performance-report + path: untrusted-artifact + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + + - name: Validate untrusted report + if: steps.download.outcome == 'success' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + EVENT_NAME=$(jq -r '.workflow_run.event' "$GITHUB_EVENT_PATH") + TRUSTED_PR_ARGUMENTS=() + if [[ "$EVENT_NAME" == 'pull_request' ]]; then + PR_NUMBER=$(jq -r '.pullRequestNumber' untrusted-artifact/performance-report.json) + if [[ ! "$PR_NUMBER" =~ ^[1-9][0-9]*$ ]]; then + echo 'Invalid pull request number in performance artifact.' >&2 + exit 1 + fi + gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER" > trusted-pull-request.json + TRUSTED_PR_ARGUMENTS=(--trusted-pull-request trusted-pull-request.json) + fi + bun scripts/performance/validate-report.ts \ + --artifact-directory untrusted-artifact \ + --output-directory validated-report \ + --expected-repository "$GITHUB_REPOSITORY" \ + --trusted-workflow-event "$GITHUB_EVENT_PATH" \ + "${TRUSTED_PR_ARGUMENTS[@]}" + + - name: Post paired comparison to the PR + if: steps.download.outcome == 'success' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bun scripts/performance/github-report.ts --directory validated-report + + - name: Install Bencher CLI + if: steps.download.outcome == 'success' && vars.NITRO_BENCHER_ENABLED == 'true' + uses: bencherdev/bencher@8d75325c3bc59403a2186a056b472c4f49d42838 # v0.6.12 + with: + version: '0.6.12' + + - name: Verify pinned Bencher binary + if: steps.download.outcome == 'success' && vars.NITRO_BENCHER_ENABLED == 'true' + run: | + printf '%s %s\n' 'c2d3a6a7fae654246134e5ced1408bdb9ba4e198b0ac3b903af17a06574a7e08' "$(command -v bencher)" | sha256sum --check - + + - name: Publish to Bencher and GitHub + if: steps.download.outcome == 'success' && vars.NITRO_BENCHER_ENABLED == 'true' + env: + BENCHER_API_KEY: ${{ secrets.BENCHER_KEY }} + BENCHER_PROJECT: nitro + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bun scripts/performance/publish.ts --directory validated-report diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml new file mode 100644 index 0000000000..876a92eeec --- /dev/null +++ b/.github/workflows/performance.yml @@ -0,0 +1,500 @@ +name: Nitro Performance + +on: + pull_request: + types: [opened, reopened, synchronize] + push: + branches: [main] + schedule: + - cron: '17 3 * * 1' + workflow_dispatch: + +concurrency: + group: performance-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + prepare: + runs-on: ubuntu-24.04 + outputs: + base_sha: ${{ steps.metadata.outputs.base_sha }} + head_sha: ${{ steps.metadata.outputs.head_sha }} + pr_number: ${{ steps.metadata.outputs.pr_number }} + relevant: ${{ steps.metadata.outputs.relevant }} + base_benchmark_available: ${{ steps.metadata.outputs.base_benchmark_available }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + fetch-depth: 0 + + - id: metadata + name: Resolve revisions and relevant paths + env: + EVENT_NAME: ${{ github.event_name }} + PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} + PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + PR_NUMBER: ${{ github.event.pull_request.number }} + PUSH_BASE_SHA: ${{ github.event.before }} + CURRENT_SHA: ${{ github.sha }} + run: | + set -euo pipefail + if [[ "$EVENT_NAME" == "pull_request" ]]; then + BASE_SHA="$PR_BASE_SHA" + HEAD_SHA="$PR_HEAD_SHA" + NUMBER="$PR_NUMBER" + elif [[ "$EVENT_NAME" == "push" && ! "$PUSH_BASE_SHA" =~ ^0+$ ]]; then + BASE_SHA="$PUSH_BASE_SHA" + HEAD_SHA="$CURRENT_SHA" + NUMBER="0" + else + BASE_SHA="$CURRENT_SHA" + HEAD_SHA="$CURRENT_SHA" + NUMBER="0" + fi + + RELEVANT=true + if [[ "$BASE_SHA" != "$HEAD_SHA" ]] && git diff --quiet "$BASE_SHA" "$HEAD_SHA" -- \ + '.github/workflows/performance.yml' \ + '.github/workflows/performance-report.yml' \ + 'bun.lock' \ + 'package.json' \ + 'scripts/performance' \ + 'apps/benchmark' \ + 'packages/react-native-nitro-modules' \ + 'packages/react-native-nitro-test' \ + 'packages/react-native-nitro-test-external'; then + RELEVANT=false + fi + + echo "base_sha=$BASE_SHA" >> "$GITHUB_OUTPUT" + echo "head_sha=$HEAD_SHA" >> "$GITHUB_OUTPUT" + echo "pr_number=$NUMBER" >> "$GITHUB_OUTPUT" + echo "relevant=$RELEVANT" >> "$GITHUB_OUTPUT" + if git cat-file -e "$BASE_SHA:apps/benchmark/package.json" 2>/dev/null; then + echo 'base_benchmark_available=true' >> "$GITHUB_OUTPUT" + else + echo 'base_benchmark_available=false' >> "$GITHUB_OUTPUT" + fi + + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 + if: steps.metadata.outputs.relevant == 'true' + with: + bun-version: 1.3.14 + - name: Test performance tooling + if: steps.metadata.outputs.relevant == 'true' + run: | + bun install --frozen-lockfile + bun run test:performance-tools + bun run typecheck:performance-tools + bun benchmark typecheck + bun benchmark lint-ci + + android: + needs: prepare + if: needs.prepare.outputs.relevant == 'true' + runs-on: ubuntu-24.04 + timeout-minutes: 90 + env: + BASE_SHA: ${{ needs.prepare.outputs.base_sha }} + HEAD_SHA: ${{ needs.prepare.outputs.head_sha }} + steps: + - name: Checkout base + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + ref: ${{ env.BASE_SHA }} + path: base + - name: Checkout head + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ env.HEAD_SHA }} + path: head + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 + with: + bun-version: 1.3.14 + - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 + with: + distribution: zulu + java-version: 17 + java-package: jdk + + - name: Enable KVM for benchmark measurements + run: | + set -euxo pipefail + test -c /dev/kvm + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + sudo udevadm settle --timeout=30 + stat --format='%A %U:%G %n' /dev/kvm + test -r /dev/kvm && test -w /dev/kvm + + - name: Select trusted controller + run: | + if [[ -f base/scripts/performance/run-sequence.ts ]]; then + echo "PERF_CONTROLLER_ROOT=$GITHUB_WORKSPACE/base" >> "$GITHUB_ENV" + else + echo "PERF_CONTROLLER_ROOT=$GITHUB_WORKSPACE/head" >> "$GITHUB_ENV" + echo "PERF_BOOTSTRAP=true" >> "$GITHUB_ENV" + fi + + - name: Build head benchmark APK + working-directory: head + run: | + bun install --frozen-lockfile + cd apps/benchmark/android + ./gradlew :app:assembleRelease --no-daemon --no-build-cache -PreactNativeArchitectures=x86_64 + + - name: Build base benchmark APK + if: env.PERF_BOOTSTRAP != 'true' + working-directory: base + run: | + bun install --frozen-lockfile + cd apps/benchmark/android + ./gradlew :app:assembleRelease --no-daemon --no-build-cache -PreactNativeArchitectures=x86_64 + + - name: Select base artifact + run: | + if [[ "$PERF_BOOTSTRAP" == "true" ]]; then + echo "BASE_APP=$GITHUB_WORKSPACE/head/apps/benchmark/android/app/build/outputs/apk/release/app-release.apk" >> "$GITHUB_ENV" + echo "BASE_ROOT=$GITHUB_WORKSPACE/head" >> "$GITHUB_ENV" + else + echo "BASE_APP=$GITHUB_WORKSPACE/base/apps/benchmark/android/app/build/outputs/apk/release/app-release.apk" >> "$GITHUB_ENV" + echo "BASE_ROOT=$GITHUB_WORKSPACE/base" >> "$GITHUB_ENV" + fi + + - name: Run paired Android benchmarks + uses: reactivecircus/android-emulator-runner@4c44018e59b437e86cdfc41da381398f93ed8808 # v2 + with: + api-level: 36 + arch: x86_64 + profile: pixel_7 + disable-animations: true + # Never silently fall back to software CPU emulation: it is slow and + # its measurements are not comparable to the KVM-backed testbed. + disable-linux-hw-accel: false + emulator-boot-timeout: 300 + pre-emulator-launch-script: '"$ANDROID_HOME/emulator/emulator" -accel-check' + emulator-options: -accel on -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none + script: >- + bun "$PERF_CONTROLLER_ROOT/scripts/performance/run-sequence.ts" + --platform android + --base-app "$BASE_APP" + --head-app "$GITHUB_WORKSPACE/head/apps/benchmark/android/app/build/outputs/apk/release/app-release.apk" + --base-root "$BASE_ROOT" + --head-root "$GITHUB_WORKSPACE/head" + --base-sha "$BASE_SHA" + --head-sha "$HEAD_SHA" + --output-directory "$GITHUB_WORKSPACE/performance-android" + --device-id "$(adb get-serialno)" + --device "Pixel 7 emulator" + --os-version "Android 16 / API 36" + --architecture x86_64 + --toolchain "JDK 17 / NDK 29.0.14206865 / KVM" + --mode advisory + + - name: Upload Android results + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: performance-android + path: performance-android + if-no-files-found: warn + retention-days: 30 + + # Same-repository contributors already have access to repository workflows. + # Forks never enter this job; their reports use the default-branch workflow_run. + # Keep reporting on a fresh runner with reviewed code, not either app checkout. + publish-pr: + name: Publish performance to PR and Bencher + needs: [prepare, nitro-performance] + if: >- + github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name == github.repository && + needs.prepare.outputs.base_benchmark_available == 'true' && + needs.nitro-performance.result == 'success' + runs-on: ubuntu-24.04 + timeout-minutes: 10 + permissions: + actions: read + contents: read + checks: write + pull-requests: write + steps: + - name: Checkout pinned reporting code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + repository: margelo/nitro + ref: f5857e95af6c07a67a6604c44ecbfc6bc365e234 + persist-credentials: false + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 + with: + bun-version: 1.3.14 + - name: Download completed benchmark data + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 + with: + name: performance-report + path: untrusted-artifact + - name: Validate against GitHub metadata and rebuild report + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: | + set -euo pipefail + gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + --jq '{repository: .repository, workflow_run: .}' > trusted-workflow-event.json + gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER" > trusted-pull-request.json + bun scripts/performance/validate-report.ts \ + --artifact-directory untrusted-artifact \ + --output-directory validated-report \ + --expected-repository "$GITHUB_REPOSITORY" \ + --trusted-workflow-event trusted-workflow-event.json \ + --trusted-pull-request trusted-pull-request.json + - name: Post paired comparison to the PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bun scripts/performance/github-report.ts --directory validated-report + - name: Install pinned Bencher CLI + if: vars.NITRO_BENCHER_ENABLED == 'true' + uses: bencherdev/bencher@8d75325c3bc59403a2186a056b472c4f49d42838 # v0.6.12 + with: + version: '0.6.12' + - name: Verify pinned Bencher binary + if: vars.NITRO_BENCHER_ENABLED == 'true' + run: | + printf '%s %s\n' 'c2d3a6a7fae654246134e5ced1408bdb9ba4e198b0ac3b903af17a06574a7e08' "$(command -v bencher)" | sha256sum --check - + - name: Publish to Bencher and GitHub + if: vars.NITRO_BENCHER_ENABLED == 'true' + env: + BENCHER_API_KEY: ${{ secrets.BENCHER_KEY }} + BENCHER_PROJECT: nitro + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bun scripts/performance/publish.ts --directory validated-report + - name: Explain disabled Bencher publishing + if: vars.NITRO_BENCHER_ENABLED != 'true' + run: echo 'Bencher uploads are disabled until the exposed key is rotated and NITRO_BENCHER_ENABLED=true. The paired PR comment is still published.' >> "$GITHUB_STEP_SUMMARY" + + ios: + needs: prepare + if: needs.prepare.outputs.relevant == 'true' + runs-on: macos-26 + timeout-minutes: 120 + env: + BASE_SHA: ${{ needs.prepare.outputs.base_sha }} + HEAD_SHA: ${{ needs.prepare.outputs.head_sha }} + steps: + - name: Checkout base + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + ref: ${{ env.BASE_SHA }} + path: base + - name: Checkout head + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ env.HEAD_SHA }} + path: head + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 + with: + bun-version: 1.3.14 + - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0 + with: + ruby-version: 3.3.0 + working-directory: head/apps/benchmark + + - name: Select Xcode 26.5 + run: sudo xcode-select -s /Applications/Xcode_26.5.app/Contents/Developer + + - name: Select trusted controller + run: | + if [[ -f base/scripts/performance/run-sequence.ts ]]; then + echo "PERF_CONTROLLER_ROOT=$GITHUB_WORKSPACE/base" >> "$GITHUB_ENV" + else + echo "PERF_CONTROLLER_ROOT=$GITHUB_WORKSPACE/head" >> "$GITHUB_ENV" + echo "PERF_BOOTSTRAP=true" >> "$GITHUB_ENV" + fi + + - name: Build head benchmark app + working-directory: head + run: | + bun install --frozen-lockfile + cd apps/benchmark + bundle install + bun pods + cd ios + xcodebuild \ + CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ + -derivedDataPath build-benchmark \ + -workspace NitroBenchmark.xcworkspace \ + -scheme NitroBenchmark \ + -configuration Release \ + -sdk iphonesimulator \ + -destination 'generic/platform=iOS Simulator' \ + ARCHS=arm64 \ + ONLY_ACTIVE_ARCH=YES \ + CODE_SIGNING_ALLOWED=NO \ + COMPILER_INDEX_STORE_ENABLE=NO \ + build + + - name: Build base benchmark app + if: env.PERF_BOOTSTRAP != 'true' + working-directory: base + run: | + bun install --frozen-lockfile + cd apps/benchmark + bundle install + bun pods + cd ios + xcodebuild \ + CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ + -derivedDataPath build-benchmark \ + -workspace NitroBenchmark.xcworkspace \ + -scheme NitroBenchmark \ + -configuration Release \ + -sdk iphonesimulator \ + -destination 'generic/platform=iOS Simulator' \ + ARCHS=arm64 \ + ONLY_ACTIVE_ARCH=YES \ + CODE_SIGNING_ALLOWED=NO \ + COMPILER_INDEX_STORE_ENABLE=NO \ + build + + - name: Select base artifact + run: | + if [[ "$PERF_BOOTSTRAP" == "true" ]]; then + echo "BASE_APP=$GITHUB_WORKSPACE/head/apps/benchmark/ios/build-benchmark/Build/Products/Release-iphonesimulator/NitroBenchmark.app" >> "$GITHUB_ENV" + echo "BASE_ROOT=$GITHUB_WORKSPACE/head" >> "$GITHUB_ENV" + else + echo "BASE_APP=$GITHUB_WORKSPACE/base/apps/benchmark/ios/build-benchmark/Build/Products/Release-iphonesimulator/NitroBenchmark.app" >> "$GITHUB_ENV" + echo "BASE_ROOT=$GITHUB_WORKSPACE/base" >> "$GITHUB_ENV" + fi + + - name: Run paired iOS benchmarks + run: | + set -euo pipefail + DEVICE_ID=$(xcrun simctl create \ + 'Nitro Performance' \ + 'com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro' \ + 'com.apple.CoreSimulator.SimRuntime.iOS-26-5') + echo "DEVICE_ID=$DEVICE_ID" >> "$GITHUB_ENV" + xcrun simctl boot "$DEVICE_ID" + DEVICE_ID="$DEVICE_ID" bun -e ' + const child = Bun.spawn(["xcrun", "simctl", "bootstatus", process.env.DEVICE_ID, "-b"], { + stdout: "inherit", stderr: "inherit", timeout: 300_000, killSignal: "SIGKILL", + }); + if (await child.exited !== 0) throw new Error("iOS simulator did not boot successfully within five minutes."); + ' + bun "$PERF_CONTROLLER_ROOT/scripts/performance/run-sequence.ts" \ + --platform ios \ + --base-app "$BASE_APP" \ + --head-app "$GITHUB_WORKSPACE/head/apps/benchmark/ios/build-benchmark/Build/Products/Release-iphonesimulator/NitroBenchmark.app" \ + --base-root "$BASE_ROOT" \ + --head-root "$GITHUB_WORKSPACE/head" \ + --base-sha "$BASE_SHA" \ + --head-sha "$HEAD_SHA" \ + --output-directory "$GITHUB_WORKSPACE/performance-ios" \ + --device-id "$DEVICE_ID" \ + --device 'iPhone 17 Pro simulator' \ + --os-version 'iOS 26.5' \ + --architecture arm64 \ + --toolchain 'Xcode 26.5' \ + --mode advisory + + - name: Delete simulator + if: always() && env.DEVICE_ID != '' + run: | + xcrun simctl shutdown "$DEVICE_ID" || true + xcrun simctl delete "$DEVICE_ID" || true + + - name: Upload iOS results + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: performance-ios + path: performance-ios + if-no-files-found: warn + retention-days: 30 + + nitro-performance: + name: nitro-performance + needs: [prepare, android, ios] + if: always() + runs-on: ubuntu-24.04 + steps: + - name: Require successful preparation + if: needs.prepare.result != 'success' + run: exit 1 + + - name: Report not applicable + if: needs.prepare.outputs.relevant != 'true' + run: | + echo '## Nitro performance' >> "$GITHUB_STEP_SUMMARY" + echo '' >> "$GITHUB_STEP_SUMMARY" + echo 'No performance-sensitive files changed.' >> "$GITHUB_STEP_SUMMARY" + + - name: Require successful platform runs + if: needs.prepare.outputs.relevant == 'true' + env: + ANDROID_RESULT: ${{ needs.android.result }} + IOS_RESULT: ${{ needs.ios.result }} + run: | + if [[ "$ANDROID_RESULT" != "success" || "$IOS_RESULT" != "success" ]]; then + echo "Android: $ANDROID_RESULT, iOS: $IOS_RESULT" >&2 + exit 1 + fi + + - name: Checkout report tooling + if: needs.prepare.outputs.relevant == 'true' + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ needs.prepare.outputs.head_sha }} + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 + if: needs.prepare.outputs.relevant == 'true' + with: + bun-version: 1.3.14 + - name: Download Android results + if: needs.prepare.outputs.relevant == 'true' + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 + with: + name: performance-android + path: artifacts/android + - name: Download iOS results + if: needs.prepare.outputs.relevant == 'true' + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 + with: + name: performance-ios + path: artifacts/ios + + - name: Build aggregate report + if: needs.prepare.outputs.relevant == 'true' + env: + REPOSITORY: ${{ github.repository }} + PR_NUMBER: ${{ needs.prepare.outputs.pr_number }} + run: | + mkdir -p performance-report/raw/android performance-report/raw/ios + bun scripts/performance/report.ts \ + --comparison artifacts/android/comparison-android.json \ + --comparison artifacts/ios/comparison-ios.json \ + --output performance-report/performance-report.json \ + --markdown-output performance-report/performance-summary.md \ + --repository "$REPOSITORY" \ + --event-name "${{ github.event_name }}" \ + --pull-request "$PR_NUMBER" + cp artifacts/android/bencher-android.json performance-report/ + cp artifacts/ios/bencher-ios.json performance-report/ + cp artifacts/android/base-*.json artifacts/android/head-*.json performance-report/raw/android/ + cp artifacts/ios/base-*.json artifacts/ios/head-*.json performance-report/raw/ios/ + cat performance-report/performance-summary.md >> "$GITHUB_STEP_SUMMARY" + + - name: Upload aggregate report + if: needs.prepare.outputs.relevant == 'true' + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: performance-report + path: performance-report + if-no-files-found: error + retention-days: 30 diff --git a/apps/benchmark/.bundle/config b/apps/benchmark/.bundle/config new file mode 100644 index 0000000000..b0d600b18a --- /dev/null +++ b/apps/benchmark/.bundle/config @@ -0,0 +1,3 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 +BUNDLE_IGNORE_FUNDING_REQUESTS: "true" diff --git a/apps/benchmark/.gitattributes b/apps/benchmark/.gitattributes new file mode 100644 index 0000000000..e27f70fa49 --- /dev/null +++ b/apps/benchmark/.gitattributes @@ -0,0 +1,3 @@ +*.pbxproj -text +# specific for windows script files +*.bat text eol=crlf diff --git a/apps/benchmark/.gitignore b/apps/benchmark/.gitignore new file mode 100644 index 0000000000..68167ceda2 --- /dev/null +++ b/apps/benchmark/.gitignore @@ -0,0 +1,76 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +build-*/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +**/.xcode.env.local + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml +*.hprof +.cxx/ +*.keystore +!debug.keystore +.kotlin/ + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/ + +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output + +# Bundle artifact +*.jsbundle + +# Ruby / CocoaPods +**/Pods/ +/vendor/bundle/ + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* + +# testing +/coverage + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions diff --git a/apps/benchmark/.watchmanconfig b/apps/benchmark/.watchmanconfig new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/apps/benchmark/.watchmanconfig @@ -0,0 +1 @@ +{} diff --git a/apps/benchmark/Gemfile b/apps/benchmark/Gemfile new file mode 100644 index 0000000000..dfd6f5dfb1 --- /dev/null +++ b/apps/benchmark/Gemfile @@ -0,0 +1,17 @@ +source 'https://rubygems.org' + +# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version +ruby ">= 2.6.10" + +# CocoaPods 1.16.2 requires xcodeproj 1.27+ for current Xcode project +# generation fixes. +gem 'cocoapods', '~> 1.16', '>= 1.16.2' +gem 'activesupport', '>= 6.1.7.5', '< 8' +gem 'xcodeproj', '>= 1.27.0', '< 2.0' + +# Ruby 3.4.0 has removed some libraries from the standard library. +gem 'bigdecimal' +gem 'logger' +gem 'benchmark' +gem 'mutex_m' +gem 'nkf' diff --git a/apps/benchmark/Gemfile.lock b/apps/benchmark/Gemfile.lock new file mode 100644 index 0000000000..e43e256502 --- /dev/null +++ b/apps/benchmark/Gemfile.lock @@ -0,0 +1,123 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.8) + activesupport (7.1.6) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) + tzinfo (~> 2.0) + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + base64 (0.3.0) + benchmark (0.4.1) + bigdecimal (3.2.2) + claide (1.1.0) + cocoapods (1.16.2) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.16.2) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.27.0, < 2.0) + cocoapods-core (1.16.2) + activesupport (>= 5.0, < 8) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (2.1) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.3.6) + connection_pool (2.5.5) + drb (2.2.3) + escape (0.0.4) + ethon (0.18.0) + ffi (>= 1.15.0) + logger + ffi (1.17.4) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.9.0) + mutex_m + i18n (1.14.6) + concurrent-ruby (~> 1.0) + json (2.19.5) + logger (1.7.0) + minitest (5.25.1) + molinillo (0.8.0) + mutex_m (0.3.0) + nanaimo (0.4.0) + nap (1.1.0) + netrc (0.11.0) + nkf (0.2.0) + public_suffix (4.0.7) + rexml (3.4.4) + ruby-macho (2.5.1) + securerandom (0.3.2) + typhoeus (1.6.0) + ethon (>= 0.18.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + xcodeproj (1.27.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.4.0) + rexml (>= 3.3.6, < 4.0) + +PLATFORMS + ruby + +DEPENDENCIES + activesupport (>= 6.1.7.5, < 8) + benchmark + bigdecimal + cocoapods (~> 1.16, >= 1.16.2) + logger + mutex_m + nkf + xcodeproj (>= 1.27.0, < 2.0) + +RUBY VERSION + ruby 3.3.0p0 + +BUNDLED WITH + 2.3.22 diff --git a/apps/benchmark/README.md b/apps/benchmark/README.md new file mode 100644 index 0000000000..ca942157aa --- /dev/null +++ b/apps/benchmark/README.md @@ -0,0 +1,94 @@ +# Nitro benchmark app + +A dedicated Release/Hermes app for measuring JS ↔ native boundary performance. +It uses the real C++, Swift/Kotlin, and generated bindings from the Nitro test +packages. It has no Harness or navigation dependencies. Correctness tests and +demos remain in `apps/example`. + +The suite runs automatically when a host receiver is present. Launching the app +alone reports a controller connection error; it does not silently substitute a +Debug benchmark or publish anything to Bencher. + +## Build + +From the repository root: + +```sh +bun install --frozen-lockfile +bun benchmark build:android + +bun benchmark bundle-install +bun benchmark pods +bun benchmark build:ios +``` + +Both platforms use the normal `Release` configuration, an embedded optimized +Hermes bundle, and no debugger or sanitizers. Android enables R8 and uses the +development signing key because this app is not distributed. Its network policy +permits cleartext only to `127.0.0.1` and `localhost` for the host receiver. + +## Run locally + +For an already booted Android API 36 emulator, after building the APK: + +```sh +bun scripts/performance/run-device.ts \ + --platform android \ + --app apps/benchmark/android/app/build/outputs/apk/release/app-release.apk \ + --output /tmp/nitro-benchmark.json \ + --device-id "$(adb get-serialno)" \ + --run-id android-local-1 \ + --reverse false \ + --commit-sha "$(git rev-parse HEAD)" \ + --suite-hash "$(bun scripts/performance/suite-hash.ts .)" \ + --device 'Local emulator' \ + --os-version 'Android 16 / API 36' \ + --architecture x86_64 \ + --toolchain 'Local JDK 17 / NDK 29.0.14206865' +``` + +Adjust device metadata to match the target. The host starts the receiver, +installs and launches the app, validates the result, and terminates the app. +The host installs each binary once, then launches a fresh process for each case +and assembles their results. This releases Nitro's runtime-scoped JSI reference +bookkeeping between cases; GC alone cannot clear that cache. Each process posts +one result only after its timing is complete. Per-case raw results are kept beside +the combined output in a `*-cases/` directory. Reversing the suite reverses the +case launch order too. Startup, transport, and process restarts are not timed. +For iOS, use `--platform ios`, a simulator UDID for `--device-id`, and the built +`NitroBenchmark.app` for `--app`, with matching simulator/toolchain metadata. +Local runs do not upload results. + +Each of the 40 metrics targets 150 ms of timed work per sample (roughly +100–200 ms), using round iteration counts with two significant digits, such as +1,500,000 or 24,000. Calibration can grow or shrink the count and is rechecked +after five warmup batches. That count is then frozen for twenty measured samples; +slow samples are retained, not discarded or adaptively shortened. + +Allocation-heavy cases split a sample into bounded chunks, collecting garbage +after each chunk and yielding for native cleanup at most every four chunks, +outside the timer. Kotlin buffer-copy and Promise cases also collect Java's heap +between chunks through a synchronous, benchmark-only TurboModule helper; Hermes +GC alone cannot reclaim Java-backed direct buffers. Cleanup is excluded from +timing. Each sample divides its accumulated timed duration by +the total operation count; the memory limit no longer caps the sample duration. +Hermes `gc()` is required, and calibration fails rather than accepting a tiny +cap-limited batch. Raw results include `iterations` and `chunkIterations`; each +sample's total timed milliseconds is `samplesNsPerOp[i] * iterations / 1e6`. +These are operation-cost measurements with explicit inter-chunk cleanup excluded, +not sustained allocation/GC throughput. Natural GC during an operation is timed. +The measured cost includes the operation, marshaling, and JS loop bookkeeping. +Input setup, checksum validation, logging, statistics, and transport are outside +the timed batch. Operation-induced allocations remain inside it. + +## CI and reporting + +See [performance CI](../../.github/PERFORMANCE.md) for the paired comparison, +noise calibration, artifacts, fork-safe reporting, and Bencher activation. +The initial infrastructure PR uses the head binary for both sides for A/A +validation because its base does not yet contain this app. Subsequent PRs build +base and head independently. Performance verdicts remain advisory. + +The example's former benchmark screen and TurboModule control have moved here. +No public Nitro API changes are needed. App dependency versions initially match +the example; automated version-alignment enforcement is a separate follow-up. diff --git a/apps/benchmark/android/app/build.gradle b/apps/benchmark/android/app/build.gradle new file mode 100644 index 0000000000..9b7c66243e --- /dev/null +++ b/apps/benchmark/android/app/build.gradle @@ -0,0 +1,124 @@ +apply plugin: "com.android.application" +apply plugin: "org.jetbrains.kotlin.android" +apply plugin: "com.facebook.react" + +/** + * This is the configuration block to customize your React Native Android app. + * By default you don't need to apply any configuration, just uncomment the lines you need. + */ +react { + reactNativeDir = file("../../../../node_modules/react-native") + codegenDir = file("../../../../node_modules/@react-native/codegen") + cliFile = file("../../../../node_modules/react-native/cli.js") + hermesCommand = "$rootDir/../../../node_modules/hermes-compiler/hermesc/%OS-BIN%/hermesc" + /* Folders */ + // The root of your project, i.e. where "package.json" lives. Default is '../..' + // root = file("../../") + // The folder where the react-native NPM package is. Default is ../../node_modules/react-native + // reactNativeDir = file("../../node_modules/react-native") + // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen + // codegenDir = file("../../node_modules/@react-native/codegen") + // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js + // cliFile = file("../../node_modules/react-native/cli.js") + + /* Variants */ + // The list of variants to that are debuggable. For those we're going to + // skip the bundling of the JS bundle and the assets. Default is "debug", "debugOptimized". + // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. + // debuggableVariants = ["liteDebug", "liteDebugOptimized", "prodDebug", "prodDebugOptimized"] + + /* Bundling */ + // A list containing the node command and its flags. Default is just 'node'. + // nodeExecutableAndArgs = ["node"] + // + // The command to run when bundling. By default is 'bundle' + // bundleCommand = "ram-bundle" + // + // The path to the CLI configuration file. Default is empty. + // bundleConfig = file(../rn-cli.config.js) + // + // The name of the generated asset file containing your JS bundle + // bundleAssetName = "MyApplication.android.bundle" + // + // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' + // entryFile = file("../js/MyApplication.android.js") + // + // A list of extra flags to pass to the 'bundle' commands. + // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle + // extraPackagerArgs = [] + + /* Hermes Commands */ + // The hermes compiler command to run. By default it is 'hermesc' + // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" + // + // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" + // hermesFlags = ["-O", "-output-source-map"] + + /* Autolinking */ + autolinkLibrariesWithApp() +} + +/** + * Set this to true to Run Proguard on Release builds to minify the Java bytecode. + */ +def enableProguardInReleaseBuilds = true + +/** + * The preferred build flavor of JavaScriptCore (JSC) + * + * For example, to use the international variant, you can use: + * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+` + * + * The international variant includes ICU i18n library and necessary data + * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that + * give correct results when using with locales other than en-US. Note that + * this variant is about 6MiB larger per architecture than default. + */ +def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+' + +android { + ndkVersion rootProject.ext.ndkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + compileSdk rootProject.ext.compileSdkVersion + + namespace "com.margelo.nitrobenchmark" + defaultConfig { + applicationId "com.margelo.nitrobenchmark" + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode 1 + versionName "1.0" + } + signingConfigs { + debug { + storeFile file('debug.keystore') + storePassword 'android' + keyAlias 'androiddebugkey' + keyPassword 'android' + } + } + buildTypes { + debug { + signingConfig signingConfigs.debug + } + release { + debuggable false + // Caution! In production, you need to generate your own keystore file. + // see https://reactnative.dev/docs/signed-apk-android. + signingConfig signingConfigs.debug + minifyEnabled enableProguardInReleaseBuilds + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + } + } +} + +dependencies { + // The version of react-native is set by the React Native Gradle Plugin + implementation("com.facebook.react:react-android") + + if (hermesEnabled.toBoolean()) { + implementation("com.facebook.react:hermes-android") + } else { + implementation jscFlavor + } +} diff --git a/apps/benchmark/android/app/debug.keystore b/apps/benchmark/android/app/debug.keystore new file mode 100644 index 0000000000..364e105ed3 Binary files /dev/null and b/apps/benchmark/android/app/debug.keystore differ diff --git a/apps/benchmark/android/app/proguard-rules.pro b/apps/benchmark/android/app/proguard-rules.pro new file mode 100644 index 0000000000..11b025724a --- /dev/null +++ b/apps/benchmark/android/app/proguard-rules.pro @@ -0,0 +1,10 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: diff --git a/apps/benchmark/android/app/src/main/AndroidManifest.xml b/apps/benchmark/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..07d3fb0992 --- /dev/null +++ b/apps/benchmark/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/apps/benchmark/android/app/src/main/java/com/margelo/nitrobenchmark/MainActivity.kt b/apps/benchmark/android/app/src/main/java/com/margelo/nitrobenchmark/MainActivity.kt new file mode 100644 index 0000000000..097f3dd667 --- /dev/null +++ b/apps/benchmark/android/app/src/main/java/com/margelo/nitrobenchmark/MainActivity.kt @@ -0,0 +1,22 @@ +package com.margelo.nitrobenchmark + +import com.facebook.react.ReactActivity +import com.facebook.react.ReactActivityDelegate +import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled +import com.facebook.react.defaults.DefaultReactActivityDelegate + +class MainActivity : ReactActivity() { + + /** + * Returns the name of the main component registered from JavaScript. This is used to schedule + * rendering of the component. + */ + override fun getMainComponentName(): String = "NitroBenchmark" + + /** + * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] + * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] + */ + override fun createReactActivityDelegate(): ReactActivityDelegate = + DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) +} diff --git a/apps/benchmark/android/app/src/main/java/com/margelo/nitrobenchmark/MainApplication.kt b/apps/benchmark/android/app/src/main/java/com/margelo/nitrobenchmark/MainApplication.kt new file mode 100644 index 0000000000..ffc5770332 --- /dev/null +++ b/apps/benchmark/android/app/src/main/java/com/margelo/nitrobenchmark/MainApplication.kt @@ -0,0 +1,27 @@ +package com.margelo.nitrobenchmark + +import android.app.Application +import com.facebook.react.PackageList +import com.facebook.react.ReactApplication +import com.facebook.react.ReactHost +import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative +import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost +import com.nitroexample.exampleturbomodule.ExampleTurboModulePackage + +class MainApplication : Application(), ReactApplication { + + override val reactHost: ReactHost by lazy { + getDefaultReactHost( + context = applicationContext, + packageList = + PackageList(this).packages.apply { + add(ExampleTurboModulePackage()) + }, + ) + } + + override fun onCreate() { + super.onCreate() + loadReactNative(this) + } +} diff --git a/apps/example/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModule.kt b/apps/benchmark/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModule.kt similarity index 57% rename from apps/example/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModule.kt rename to apps/benchmark/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModule.kt index 6c5a943511..555d87eacc 100644 --- a/apps/example/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModule.kt +++ b/apps/benchmark/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModule.kt @@ -9,7 +9,16 @@ class ExampleTurboModuleModule(reactContext: ReactApplicationContext) : NativeEx return a + b } + override fun collectGarbage(): Boolean { + // Hermes collection alone cannot reclaim Java-backed direct buffers. + // Return a value so React Native codegen makes this call synchronous. + System.gc() + System.runFinalization() + System.gc() + return true + } + companion object { const val NAME = "ExampleTurboModule" } -} \ No newline at end of file +} diff --git a/apps/example/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModulePackage.kt b/apps/benchmark/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModulePackage.kt similarity index 100% rename from apps/example/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModulePackage.kt rename to apps/benchmark/android/app/src/main/java/com/nitroexample/exampleturbomodule/ExampleTurboModulePackage.kt diff --git a/apps/benchmark/android/app/src/main/res/drawable/rn_edit_text_material.xml b/apps/benchmark/android/app/src/main/res/drawable/rn_edit_text_material.xml new file mode 100644 index 0000000000..5c25e728ea --- /dev/null +++ b/apps/benchmark/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/apps/benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..a2f5908281 Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/apps/benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/apps/benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000000..1b52399808 Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/apps/benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..ff10afd6e1 Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/apps/benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/apps/benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000000..115a4c768a Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/apps/benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..dcd3cd8083 Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/apps/benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/apps/benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000000..459ca609d3 Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/apps/benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..8ca12fe024 Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/apps/benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/apps/benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000000..8e19b410a1 Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/apps/benchmark/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/benchmark/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000..b824ebdd48 Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/apps/benchmark/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/apps/benchmark/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000000..4c19a13c23 Binary files /dev/null and b/apps/benchmark/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/apps/benchmark/android/app/src/main/res/values/strings.xml b/apps/benchmark/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000000..9db949776f --- /dev/null +++ b/apps/benchmark/android/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + NitroBenchmark + diff --git a/apps/benchmark/android/app/src/main/res/values/styles.xml b/apps/benchmark/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000000..7ba83a2ad5 --- /dev/null +++ b/apps/benchmark/android/app/src/main/res/values/styles.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/apps/benchmark/android/app/src/main/res/xml/network_security_config.xml b/apps/benchmark/android/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000000..af8b89310b --- /dev/null +++ b/apps/benchmark/android/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,8 @@ + + + + + 127.0.0.1 + localhost + + diff --git a/apps/benchmark/android/build.gradle b/apps/benchmark/android/build.gradle new file mode 100644 index 0000000000..41f3478a60 --- /dev/null +++ b/apps/benchmark/android/build.gradle @@ -0,0 +1,21 @@ +buildscript { + ext { + buildToolsVersion = "36.1.0" + minSdkVersion = 24 + compileSdkVersion = 36 + targetSdkVersion = 36 + ndkVersion = "29.0.14206865" + kotlinVersion = "2.1.21" + } + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle") + classpath("com.facebook.react:react-native-gradle-plugin") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") + } +} + +apply plugin: "com.facebook.react.rootproject" diff --git a/apps/benchmark/android/gradle.properties b/apps/benchmark/android/gradle.properties new file mode 100644 index 0000000000..9afe61598f --- /dev/null +++ b/apps/benchmark/android/gradle.properties @@ -0,0 +1,44 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m +org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true + +# Use this property to specify which architecture you want to build. +# You can also override it from the CLI using +# ./gradlew -PreactNativeArchitectures=x86_64 +reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 + +# Use this property to enable support to the new architecture. +# This will allow you to use TurboModules and the Fabric render in +# your application. You should enable this flag either if you want +# to write custom TurboModules/Fabric components OR use libraries that +# are providing them. +newArchEnabled=true + +# Use this property to enable or disable the Hermes JS engine. +# If set to false, you will be using JSC instead. +hermesEnabled=true + +# Use this property to enable edge-to-edge display support. +# This allows your app to draw behind system bars for an immersive UI. +# Note: Only works with ReactActivity and should not be used with custom Activity. +edgeToEdgeEnabled=false diff --git a/apps/benchmark/android/gradle/wrapper/gradle-wrapper.jar b/apps/benchmark/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..61285a659d Binary files /dev/null and b/apps/benchmark/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/apps/benchmark/android/gradle/wrapper/gradle-wrapper.properties b/apps/benchmark/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..37f78a6af8 --- /dev/null +++ b/apps/benchmark/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/apps/benchmark/android/gradlew b/apps/benchmark/android/gradlew new file mode 100755 index 0000000000..adff685a03 --- /dev/null +++ b/apps/benchmark/android/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/apps/benchmark/android/gradlew.bat b/apps/benchmark/android/gradlew.bat new file mode 100644 index 0000000000..4626b902d5 --- /dev/null +++ b/apps/benchmark/android/gradlew.bat @@ -0,0 +1,98 @@ +@REM Copyright (c) Meta Platforms, Inc. and affiliates. +@REM +@REM This source code is licensed under the MIT license found in the +@REM LICENSE file in the root directory of this source tree. + +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/apps/benchmark/android/settings.gradle b/apps/benchmark/android/settings.gradle new file mode 100644 index 0000000000..3e24116a12 --- /dev/null +++ b/apps/benchmark/android/settings.gradle @@ -0,0 +1,6 @@ +pluginManagement { includeBuild("../../../node_modules/@react-native/gradle-plugin") } +plugins { id("com.facebook.react.settings") } +extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } +rootProject.name = 'NitroBenchmark' +include ':app' +includeBuild('../../../node_modules/@react-native/gradle-plugin') diff --git a/apps/benchmark/app.json b/apps/benchmark/app.json new file mode 100644 index 0000000000..c3cd23d20f --- /dev/null +++ b/apps/benchmark/app.json @@ -0,0 +1,4 @@ +{ + "name": "NitroBenchmark", + "displayName": "NitroBenchmark" +} diff --git a/apps/benchmark/babel.config.js b/apps/benchmark/babel.config.js new file mode 100644 index 0000000000..3e0218e68f --- /dev/null +++ b/apps/benchmark/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ['module:@react-native/babel-preset'], +} diff --git a/apps/benchmark/index.js b/apps/benchmark/index.js new file mode 100644 index 0000000000..c7cc59aaea --- /dev/null +++ b/apps/benchmark/index.js @@ -0,0 +1,9 @@ +/** + * @format + */ + +import { AppRegistry } from 'react-native' +import { BenchmarkApp } from './src/benchmarks/BenchmarkApp' +import { name as appName } from './app.json' + +AppRegistry.registerComponent(appName, () => BenchmarkApp) diff --git a/apps/benchmark/ios/.xcode.env b/apps/benchmark/ios/.xcode.env new file mode 100644 index 0000000000..3d5782c715 --- /dev/null +++ b/apps/benchmark/ios/.xcode.env @@ -0,0 +1,11 @@ +# This `.xcode.env` file is versioned and is used to source the environment +# used when running script phases inside Xcode. +# To customize your local environment, you can create an `.xcode.env.local` +# file that is not versioned. + +# NODE_BINARY variable contains the PATH to the node executable. +# +# Customize the NODE_BINARY variable here. +# For example, to use nvm with brew, add the following line +# . "$(brew --prefix nvm)/nvm.sh" --no-use +export NODE_BINARY=$(command -v node) diff --git a/apps/example/ios/Example Turbo Module/MGLExampleTurboModule.h b/apps/benchmark/ios/Example Turbo Module/MGLExampleTurboModule.h similarity index 100% rename from apps/example/ios/Example Turbo Module/MGLExampleTurboModule.h rename to apps/benchmark/ios/Example Turbo Module/MGLExampleTurboModule.h diff --git a/apps/example/ios/Example Turbo Module/MGLExampleTurboModule.mm b/apps/benchmark/ios/Example Turbo Module/MGLExampleTurboModule.mm similarity index 80% rename from apps/example/ios/Example Turbo Module/MGLExampleTurboModule.mm rename to apps/benchmark/ios/Example Turbo Module/MGLExampleTurboModule.mm index 69b343ecea..3ef26592ef 100644 --- a/apps/example/ios/Example Turbo Module/MGLExampleTurboModule.mm +++ b/apps/benchmark/ios/Example Turbo Module/MGLExampleTurboModule.mm @@ -16,6 +16,11 @@ - (NSNumber*)addNumbers:(double)a b:(double)b { return result; } +- (NSNumber*)collectGarbage { + // iOS uses ARC/autorelease pools, drained by the sampler's native timer yield. + return @YES; +} + - (std::shared_ptr)getTurboModule: (const facebook::react::ObjCTurboModule::InitParams &)params { diff --git a/apps/benchmark/ios/NitroBenchmark.xcodeproj/project.pbxproj b/apps/benchmark/ios/NitroBenchmark.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..29e291bc4b --- /dev/null +++ b/apps/benchmark/ios/NitroBenchmark.xcodeproj/project.pbxproj @@ -0,0 +1,525 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 0C80B921A6F3F58F76C31292 /* libPods-NitroBenchmark.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-NitroBenchmark.a */; }; + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 594F07C9B4040625C3C862CC /* MGLExampleTurboModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5BE2E28D9DF88FD9C1319BF2 /* MGLExampleTurboModule.mm */; }; + 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; }; + 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + B34182BC0EDC1CB52B51A605 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 13B07F961A680F5B00A75B9A /* NitroBenchmark.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NitroBenchmark.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = NitroBenchmark/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = NitroBenchmark/Info.plist; sourceTree = ""; }; + 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = NitroBenchmark/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 3B4392A12AC88292D35C810B /* Pods-NitroBenchmark.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NitroBenchmark.debug.xcconfig"; path = "Target Support Files/Pods-NitroBenchmark/Pods-NitroBenchmark.debug.xcconfig"; sourceTree = ""; }; + 5709B34CF0A7D63546082F79 /* Pods-NitroBenchmark.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NitroBenchmark.release.xcconfig"; path = "Target Support Files/Pods-NitroBenchmark/Pods-NitroBenchmark.release.xcconfig"; sourceTree = ""; }; + 5BE2E28D9DF88FD9C1319BF2 /* MGLExampleTurboModule.mm */ = {isa = PBXFileReference; includeInIndex = 1; path = MGLExampleTurboModule.mm; sourceTree = ""; }; + 5DCACB8F33CDC322A6C60F78 /* libPods-NitroBenchmark.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NitroBenchmark.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = NitroBenchmark/AppDelegate.swift; sourceTree = ""; }; + 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = NitroBenchmark/LaunchScreen.storyboard; sourceTree = ""; }; + E5B0A2BAFD69C2E4E4943D8E /* MGLExampleTurboModule.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = MGLExampleTurboModule.h; sourceTree = ""; }; + ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0C80B921A6F3F58F76C31292 /* libPods-NitroBenchmark.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 13B07FAE1A68108700A75B9A /* NitroBenchmark */ = { + isa = PBXGroup; + children = ( + 13B07FB51A68108700A75B9A /* Images.xcassets */, + 761780EC2CA45674006654EE /* AppDelegate.swift */, + 13B07FB61A68108700A75B9A /* Info.plist */, + 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, + 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */, + ); + name = NitroBenchmark; + sourceTree = ""; + }; + 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { + isa = PBXGroup; + children = ( + ED297162215061F000B7C4FE /* JavaScriptCore.framework */, + 5DCACB8F33CDC322A6C60F78 /* libPods-NitroBenchmark.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 832341AE1AAA6A7D00B99B32 /* Libraries */ = { + isa = PBXGroup; + children = ( + ); + name = Libraries; + sourceTree = ""; + }; + 83CBB9F61A601CBA00E9B192 = { + isa = PBXGroup; + children = ( + 13B07FAE1A68108700A75B9A /* NitroBenchmark */, + 832341AE1AAA6A7D00B99B32 /* Libraries */, + 83CBBA001A601CBA00E9B192 /* Products */, + 2D16E6871FA4F8E400B85C8A /* Frameworks */, + BBD78D7AC51CEA395F1C20DB /* Pods */, + BE379B7735B4ED0D7980364B /* Example Turbo Module */, + ); + indentWidth = 2; + sourceTree = ""; + tabWidth = 2; + usesTabs = 0; + }; + 83CBBA001A601CBA00E9B192 /* Products */ = { + isa = PBXGroup; + children = ( + 13B07F961A680F5B00A75B9A /* NitroBenchmark.app */, + ); + name = Products; + sourceTree = ""; + }; + BBD78D7AC51CEA395F1C20DB /* Pods */ = { + isa = PBXGroup; + children = ( + 3B4392A12AC88292D35C810B /* Pods-NitroBenchmark.debug.xcconfig */, + 5709B34CF0A7D63546082F79 /* Pods-NitroBenchmark.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + BE379B7735B4ED0D7980364B /* Example Turbo Module */ = { + isa = PBXGroup; + children = ( + E5B0A2BAFD69C2E4E4943D8E /* MGLExampleTurboModule.h */, + 5BE2E28D9DF88FD9C1319BF2 /* MGLExampleTurboModule.mm */, + ); + name = "Example Turbo Module"; + path = "Example Turbo Module"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 13B07F861A680F5B00A75B9A /* NitroBenchmark */ = { + isa = PBXNativeTarget; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "NitroBenchmark" */; + buildPhases = ( + C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, + 13B07F871A680F5B00A75B9A /* Sources */, + 13B07F8C1A680F5B00A75B9A /* Frameworks */, + 13B07F8E1A680F5B00A75B9A /* Resources */, + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, + 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, + E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = NitroBenchmark; + productName = NitroBenchmark; + productReference = 13B07F961A680F5B00A75B9A /* NitroBenchmark.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 83CBB9F71A601CBA00E9B192 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1210; + TargetAttributes = { + 13B07F861A680F5B00A75B9A = { + LastSwiftMigration = 1120; + }; + }; + }; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NitroBenchmark" */; + compatibilityVersion = "Xcode 12.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 83CBB9F61A601CBA00E9B192; + productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 13B07F861A680F5B00A75B9A /* NitroBenchmark */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 13B07F8E1A680F5B00A75B9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, + B34182BC0EDC1CB52B51A605 /* PrivacyInfo.xcprivacy in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/.xcode.env.local", + "$(SRCROOT)/.xcode.env", + ); + name = "Bundle React Native code and images"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"\\\"$WITH_ENVIRONMENT\\\" \\\"$REACT_NATIVE_XCODE\\\"\"\n"; + }; + 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-NitroBenchmark/Pods-NitroBenchmark-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-NitroBenchmark/Pods-NitroBenchmark-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NitroBenchmark/Pods-NitroBenchmark-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-NitroBenchmark-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-NitroBenchmark/Pods-NitroBenchmark-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-NitroBenchmark/Pods-NitroBenchmark-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NitroBenchmark/Pods-NitroBenchmark-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 13B07F871A680F5B00A75B9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */, + 594F07C9B4040625C3C862CC /* MGLExampleTurboModule.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 13B07F941A680F5B00A75B9A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-NitroBenchmark.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = NitroBenchmark/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.margelo.nitrobenchmark; + PRODUCT_NAME = NitroBenchmark; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SWIFT_ENABLE_EXPLICIT_MODULES = NO; + SWIFT_OBJC_INTEROP_MODE = objcxx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 13B07F951A680F5B00A75B9A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-NitroBenchmark.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + ENABLE_ADDRESS_SANITIZER = NO; + ENABLE_TESTABILITY = NO; + ENABLE_THREAD_SANITIZER = NO; + ENABLE_UNDEFINED_BEHAVIOR_SANITIZER = NO; + GCC_GENERATE_TEST_COVERAGE_FILES = NO; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO; + INFOPLIST_FILE = NitroBenchmark/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.margelo.nitrobenchmark; + PRODUCT_NAME = NitroBenchmark; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_ENABLE_EXPLICIT_MODULES = NO; + SWIFT_OBJC_INTEROP_MODE = objcxx; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + 83CBBA201A601CBA00E9B192 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + /usr/lib/swift, + "$(inherited)", + ); + LIBRARY_SEARCH_PATHS = ( + "\"$(SDKROOT)/usr/lib/swift\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = ( + "$(inherited)", + "-DRCT_REMOVE_LEGACY_ARCH=1", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-DFOLLY_NO_CONFIG", + "-DFOLLY_MOBILE=1", + "-DFOLLY_USE_LIBCPP=1", + "-DFOLLY_CFG_NO_COROUTINES=1", + "-DFOLLY_HAVE_CLOCK_GETTIME=1", + "-DRCT_REMOVE_LEGACY_ARCH=1", + ); + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; + SWIFT_ENABLE_EXPLICIT_MODULES = NO; + USE_HERMES = true; + }; + name = Debug; + }; + 83CBBA211A601CBA00E9B192 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.1; + LD_RUNPATH_SEARCH_PATHS = ( + /usr/lib/swift, + "$(inherited)", + ); + LIBRARY_SEARCH_PATHS = ( + "\"$(SDKROOT)/usr/lib/swift\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_CFLAGS = ( + "$(inherited)", + "-DRCT_REMOVE_LEGACY_ARCH=1", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-DFOLLY_NO_CONFIG", + "-DFOLLY_MOBILE=1", + "-DFOLLY_USE_LIBCPP=1", + "-DFOLLY_CFG_NO_COROUTINES=1", + "-DFOLLY_HAVE_CLOCK_GETTIME=1", + "-DRCT_REMOVE_LEGACY_ARCH=1", + ); + REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native"; + SDKROOT = iphoneos; + SWIFT_ENABLE_EXPLICIT_MODULES = NO; + USE_HERMES = true; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "NitroBenchmark" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 13B07F941A680F5B00A75B9A /* Debug */, + 13B07F951A680F5B00A75B9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NitroBenchmark" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83CBBA201A601CBA00E9B192 /* Debug */, + 83CBBA211A601CBA00E9B192 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; +} diff --git a/apps/benchmark/ios/NitroBenchmark.xcodeproj/xcshareddata/xcschemes/NitroBenchmark.xcscheme b/apps/benchmark/ios/NitroBenchmark.xcodeproj/xcshareddata/xcschemes/NitroBenchmark.xcscheme new file mode 100644 index 0000000000..1041a0217e --- /dev/null +++ b/apps/benchmark/ios/NitroBenchmark.xcodeproj/xcshareddata/xcschemes/NitroBenchmark.xcscheme @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/benchmark/ios/NitroBenchmark.xcworkspace/contents.xcworkspacedata b/apps/benchmark/ios/NitroBenchmark.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..8db9158925 --- /dev/null +++ b/apps/benchmark/ios/NitroBenchmark.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/apps/benchmark/ios/NitroBenchmark/AppDelegate.swift b/apps/benchmark/ios/NitroBenchmark/AppDelegate.swift new file mode 100644 index 0000000000..cbea7ed92a --- /dev/null +++ b/apps/benchmark/ios/NitroBenchmark/AppDelegate.swift @@ -0,0 +1,48 @@ +import UIKit +import React +import React_RCTAppDelegate +import ReactAppDependencyProvider + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + var reactNativeDelegate: ReactNativeDelegate? + var reactNativeFactory: RCTReactNativeFactory? + + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil + ) -> Bool { + let delegate = ReactNativeDelegate() + let factory = RCTReactNativeFactory(delegate: delegate) + delegate.dependencyProvider = RCTAppDependencyProvider() + + reactNativeDelegate = delegate + reactNativeFactory = factory + + window = UIWindow(frame: UIScreen.main.bounds) + + factory.startReactNative( + withModuleName: "NitroBenchmark", + in: window, + launchOptions: launchOptions + ) + + return true + } +} + +class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate { + override func sourceURL(for bridge: RCTBridge) -> URL? { + self.bundleURL() + } + + override func bundleURL() -> URL? { +#if DEBUG + RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") +#else + Bundle.main.url(forResource: "main", withExtension: "jsbundle") +#endif + } +} diff --git a/apps/benchmark/ios/NitroBenchmark/Images.xcassets/AppIcon.appiconset/Contents.json b/apps/benchmark/ios/NitroBenchmark/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..81213230de --- /dev/null +++ b/apps/benchmark/ios/NitroBenchmark/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,53 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/apps/benchmark/ios/NitroBenchmark/Images.xcassets/Contents.json b/apps/benchmark/ios/NitroBenchmark/Images.xcassets/Contents.json new file mode 100644 index 0000000000..2d92bd53fd --- /dev/null +++ b/apps/benchmark/ios/NitroBenchmark/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/benchmark/ios/NitroBenchmark/Info.plist b/apps/benchmark/ios/NitroBenchmark/Info.plist new file mode 100644 index 0000000000..b7fcc7bb82 --- /dev/null +++ b/apps/benchmark/ios/NitroBenchmark/Info.plist @@ -0,0 +1,58 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + NitroBenchmark + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSAllowsLocalNetworking + + + RCTNewArchEnabled + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/apps/benchmark/ios/NitroBenchmark/LaunchScreen.storyboard b/apps/benchmark/ios/NitroBenchmark/LaunchScreen.storyboard new file mode 100644 index 0000000000..3dd25da1a4 --- /dev/null +++ b/apps/benchmark/ios/NitroBenchmark/LaunchScreen.storyboard @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/benchmark/ios/NitroBenchmark/PrivacyInfo.xcprivacy b/apps/benchmark/ios/NitroBenchmark/PrivacyInfo.xcprivacy new file mode 100644 index 0000000000..41b8317f06 --- /dev/null +++ b/apps/benchmark/ios/NitroBenchmark/PrivacyInfo.xcprivacy @@ -0,0 +1,37 @@ + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + + + diff --git a/apps/benchmark/ios/Podfile b/apps/benchmark/ios/Podfile new file mode 100644 index 0000000000..5e465fb835 --- /dev/null +++ b/apps/benchmark/ios/Podfile @@ -0,0 +1,38 @@ +ENV['RCT_NEW_ARCH_ENABLED'] = '1' +ENV['RCT_USE_RN_DEP'] = '1' +ENV['RCT_USE_PREBUILT_RNCORE'] = '1' + +# Resolve react_native_pods.rb with node to allow for hoisting +require Pod::Executable.execute_command('node', ['-p', + 'require.resolve( + "react-native/scripts/react_native_pods.rb", + {paths: [process.argv[1]]}, + )', __dir__]).strip + +platform :ios, min_ios_version_supported +prepare_react_native_project! + +linkage = ENV['USE_FRAMEWORKS'] +if linkage != nil + Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green + use_frameworks! :linkage => linkage.to_sym +end + +target 'NitroBenchmark' do + config = use_native_modules! + + use_react_native!( + :path => config[:reactNativePath], + # An absolute path to your application root. + :app_path => "#{Pod::Config.instance.installation_root}/.." + ) + + post_install do |installer| + react_native_post_install( + installer, + config[:reactNativePath], + :mac_catalyst_enabled => false, + # :ccache_enabled => true + ) + end +end diff --git a/apps/benchmark/ios/Podfile.lock b/apps/benchmark/ios/Podfile.lock new file mode 100644 index 0000000000..44ad644c50 --- /dev/null +++ b/apps/benchmark/ios/Podfile.lock @@ -0,0 +1,2182 @@ +PODS: + - FBLazyVector (0.85.3) + - hermes-engine (250829098.0.10): + - hermes-engine/Pre-built (= 250829098.0.10) + - hermes-engine/Pre-built (250829098.0.10) + - NitroModules (0.37.1): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-callinvoker + - React-Core + - React-Core-prebuilt + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - NitroTest (0.37.1): + - hermes-engine + - NitroModules + - NitroTestExternal + - RCTRequired + - RCTTypeSafety + - React-callinvoker + - React-Core + - React-Core-prebuilt + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - NitroTestExternal (0.37.1): + - hermes-engine + - NitroModules + - RCTRequired + - RCTTypeSafety + - React-callinvoker + - React-Core + - React-Core-prebuilt + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - RCTDeprecation (0.85.3) + - RCTRequired (0.85.3) + - RCTSwiftUI (0.85.3) + - RCTSwiftUIWrapper (0.85.3): + - RCTSwiftUI + - RCTTypeSafety (0.85.3): + - FBLazyVector (= 0.85.3) + - RCTRequired (= 0.85.3) + - React-Core (= 0.85.3) + - React (0.85.3): + - React-Core (= 0.85.3) + - React-Core/DevSupport (= 0.85.3) + - React-Core/RCTWebSocket (= 0.85.3) + - React-RCTActionSheet (= 0.85.3) + - React-RCTAnimation (= 0.85.3) + - React-RCTBlob (= 0.85.3) + - React-RCTImage (= 0.85.3) + - React-RCTLinking (= 0.85.3) + - React-RCTNetwork (= 0.85.3) + - React-RCTSettings (= 0.85.3) + - React-RCTText (= 0.85.3) + - React-RCTVibration (= 0.85.3) + - React-callinvoker (0.85.3) + - React-Core (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default (= 0.85.3) + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core-prebuilt (0.85.3): + - ReactNativeDependencies + - React-Core/CoreModulesHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/Default (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/DevSupport (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default (= 0.85.3) + - React-Core/RCTWebSocket (= 0.85.3) + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTActionSheetHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTAnimationHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTBlobHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTImageHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTLinkingHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTNetworkHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTSettingsHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTTextHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTVibrationHeaders (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-Core/RCTWebSocket (0.85.3): + - hermes-engine + - RCTDeprecation + - React-Core-prebuilt + - React-Core/Default (= 0.85.3) + - React-cxxreact + - React-featureflags + - React-hermes + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsinspectorcdp + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-CoreModules (0.85.3): + - RCTTypeSafety (= 0.85.3) + - React-Core-prebuilt + - React-Core/CoreModulesHeaders (= 0.85.3) + - React-debug + - React-featureflags + - React-jsi (= 0.85.3) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-NativeModulesApple + - React-RCTBlob + - React-RCTFBReactNativeSpec + - React-RCTImage (= 0.85.3) + - React-runtimeexecutor + - React-utils + - ReactCommon + - ReactNativeDependencies + - React-cxxreact (0.85.3): + - hermes-engine + - React-callinvoker (= 0.85.3) + - React-Core-prebuilt + - React-debug (= 0.85.3) + - React-jsi (= 0.85.3) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-logger (= 0.85.3) + - React-perflogger (= 0.85.3) + - React-runtimeexecutor + - React-timing (= 0.85.3) + - React-utils + - ReactNativeDependencies + - React-debug (0.85.3): + - React-debug/redbox (= 0.85.3) + - React-debug/redbox (0.85.3) + - React-defaultsnativemodule (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-domnativemodule + - React-Fabric/animated + - React-featureflags + - React-featureflagsnativemodule + - React-idlecallbacksnativemodule + - React-intersectionobservernativemodule + - React-jsi + - React-jsiexecutor + - React-microtasksnativemodule + - React-mutationobservernativemodule + - React-RCTFBReactNativeSpec + - React-webperformancenativemodule + - ReactNativeDependencies + - Yoga + - React-domnativemodule (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-Fabric + - React-Fabric/bridging + - React-FabricComponents + - React-graphics + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-Fabric (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric/animated (= 0.85.3) + - React-Fabric/animationbackend (= 0.85.3) + - React-Fabric/animations (= 0.85.3) + - React-Fabric/attributedstring (= 0.85.3) + - React-Fabric/bridging (= 0.85.3) + - React-Fabric/componentregistry (= 0.85.3) + - React-Fabric/componentregistrynative (= 0.85.3) + - React-Fabric/components (= 0.85.3) + - React-Fabric/consistency (= 0.85.3) + - React-Fabric/core (= 0.85.3) + - React-Fabric/dom (= 0.85.3) + - React-Fabric/imagemanager (= 0.85.3) + - React-Fabric/leakchecker (= 0.85.3) + - React-Fabric/mounting (= 0.85.3) + - React-Fabric/observers (= 0.85.3) + - React-Fabric/scheduler (= 0.85.3) + - React-Fabric/telemetry (= 0.85.3) + - React-Fabric/uimanager (= 0.85.3) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/animated (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric/animationbackend + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/animationbackend (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/animations (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/attributedstring (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/bridging (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/componentregistry (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/componentregistrynative (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/components (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric/components/legacyviewmanagerinterop (= 0.85.3) + - React-Fabric/components/root (= 0.85.3) + - React-Fabric/components/scrollview (= 0.85.3) + - React-Fabric/components/view (= 0.85.3) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/components/legacyviewmanagerinterop (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/components/root (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/components/scrollview (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/components/view (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-renderercss + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-Fabric/consistency (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/core (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/dom (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/imagemanager (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/leakchecker (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/mounting (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/observers (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric/observers/events (= 0.85.3) + - React-Fabric/observers/intersection (= 0.85.3) + - React-Fabric/observers/mutation (= 0.85.3) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/observers/events (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/observers/intersection (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/observers/mutation (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/scheduler (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric/animationbackend + - React-Fabric/observers/events + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-performancecdpmetrics + - React-performancetimeline + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/telemetry (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/uimanager (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric/uimanager/consistency (= 0.85.3) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererconsistency + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-Fabric/uimanager/consistency (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererconsistency + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-FabricComponents (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-FabricComponents/components (= 0.85.3) + - React-FabricComponents/textlayoutmanager (= 0.85.3) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-FabricComponents/components/inputaccessory (= 0.85.3) + - React-FabricComponents/components/iostextinput (= 0.85.3) + - React-FabricComponents/components/modal (= 0.85.3) + - React-FabricComponents/components/rncore (= 0.85.3) + - React-FabricComponents/components/safeareaview (= 0.85.3) + - React-FabricComponents/components/scrollview (= 0.85.3) + - React-FabricComponents/components/switch (= 0.85.3) + - React-FabricComponents/components/text (= 0.85.3) + - React-FabricComponents/components/textinput (= 0.85.3) + - React-FabricComponents/components/unimplementedview (= 0.85.3) + - React-FabricComponents/components/virtualview (= 0.85.3) + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/inputaccessory (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/iostextinput (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/modal (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/rncore (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/safeareaview (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/scrollview (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/switch (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/text (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/textinput (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/unimplementedview (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/components/virtualview (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricComponents/textlayoutmanager (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-FabricImage (0.85.3): + - hermes-engine + - RCTRequired (= 0.85.3) + - RCTTypeSafety (= 0.85.3) + - React-Core-prebuilt + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-jsiexecutor (= 0.85.3) + - React-logger + - React-rendererdebug + - React-utils + - ReactCommon + - ReactNativeDependencies + - Yoga + - React-featureflags (0.85.3): + - React-Core-prebuilt + - ReactNativeDependencies + - React-featureflagsnativemodule (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-featureflags + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-graphics (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-featureflags + - React-jsi + - React-jsiexecutor + - React-utils + - ReactNativeDependencies + - React-hermes (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-cxxreact (= 0.85.3) + - React-jsi + - React-jsiexecutor (= 0.85.3) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-jsitooling + - React-oscompat + - React-perflogger (= 0.85.3) + - React-runtimeexecutor + - ReactNativeDependencies + - React-idlecallbacksnativemodule (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - React-runtimescheduler + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-ImageManager (0.85.3): + - React-Core-prebuilt + - React-Core/Default + - React-debug + - React-Fabric + - React-graphics + - React-rendererdebug + - React-utils + - ReactNativeDependencies + - React-intersectionobservernativemodule (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-cxxreact + - React-Fabric + - React-Fabric/bridging + - React-graphics + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - React-runtimescheduler + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-jserrorhandler (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-jsi + - ReactCommon/turbomodule/bridging + - ReactNativeDependencies + - React-jsi (0.85.3): + - hermes-engine + - React-Core-prebuilt + - ReactNativeDependencies + - React-jsiexecutor (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-jserrorhandler + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-jsitooling + - React-perflogger + - React-runtimeexecutor + - React-utils + - ReactNativeDependencies + - React-jsinspector (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-featureflags + - React-jsi + - React-jsinspectorcdp + - React-jsinspectornetwork + - React-jsinspectortracing + - React-oscompat + - React-perflogger (= 0.85.3) + - React-runtimeexecutor + - React-utils + - ReactNativeDependencies + - React-jsinspectorcdp (0.85.3): + - React-Core-prebuilt + - ReactNativeDependencies + - React-jsinspectornetwork (0.85.3): + - React-Core-prebuilt + - React-jsinspectorcdp + - ReactNativeDependencies + - React-jsinspectortracing (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-jsi + - React-jsinspectornetwork + - React-oscompat + - React-timing + - React-utils + - ReactNativeDependencies + - React-jsitooling (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-cxxreact (= 0.85.3) + - React-debug + - React-jsi (= 0.85.3) + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-runtimeexecutor + - React-utils + - ReactNativeDependencies + - React-jsitracing (0.85.3): + - React-jsi + - React-logger (0.85.3): + - React-Core-prebuilt + - ReactNativeDependencies + - React-Mapbuffer (0.85.3): + - React-Core-prebuilt + - React-debug + - ReactNativeDependencies + - React-microtasksnativemodule (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-mutationobservernativemodule (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-cxxreact + - React-Fabric + - React-Fabric/bridging + - React-Fabric/observers/mutation + - React-featureflags + - React-jsi + - React-jsiexecutor + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - Yoga + - React-NativeModulesApple (0.85.3): + - hermes-engine + - React-callinvoker + - React-Core + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-runtimeexecutor + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - React-networking (0.85.3): + - React-Core-prebuilt + - React-jsinspectornetwork + - React-jsinspectortracing + - React-performancetimeline + - React-timing + - ReactNativeDependencies + - React-oscompat (0.85.3) + - React-perflogger (0.85.3): + - React-Core-prebuilt + - ReactNativeDependencies + - React-performancecdpmetrics (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-jsi + - React-performancetimeline + - React-runtimeexecutor + - React-timing + - ReactNativeDependencies + - React-performancetimeline (0.85.3): + - React-Core-prebuilt + - React-featureflags + - React-jsinspector + - React-jsinspectortracing + - React-perflogger + - React-timing + - ReactNativeDependencies + - React-RCTActionSheet (0.85.3): + - React-Core/RCTActionSheetHeaders (= 0.85.3) + - React-RCTAnimation (0.85.3): + - RCTTypeSafety + - React-Core-prebuilt + - React-Core/RCTAnimationHeaders + - React-debug + - React-featureflags + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - ReactNativeDependencies + - React-RCTAppDelegate (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-CoreModules + - React-debug + - React-defaultsnativemodule + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-jsitooling + - React-NativeModulesApple + - React-RCTFabric + - React-RCTFBReactNativeSpec + - React-RCTImage + - React-RCTNetwork + - React-RCTRuntime + - React-rendererdebug + - React-RuntimeApple + - React-RuntimeCore + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon + - ReactNativeDependencies + - React-RCTBlob (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-Core/RCTBlobHeaders + - React-Core/RCTWebSocket + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - React-RCTNetwork + - ReactCommon + - ReactNativeDependencies + - React-RCTFabric (0.85.3): + - hermes-engine + - RCTSwiftUIWrapper + - React-Core + - React-Core-prebuilt + - React-debug + - React-Fabric + - React-FabricComponents + - React-FabricImage + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-networking + - React-performancecdpmetrics + - React-performancetimeline + - React-RCTAnimation + - React-RCTFBReactNativeSpec + - React-RCTImage + - React-RCTText + - React-rendererconsistency + - React-renderercss + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - Yoga + - React-RCTFBReactNativeSpec (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec/components (= 0.85.3) + - ReactCommon + - ReactNativeDependencies + - React-RCTFBReactNativeSpec/components (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-NativeModulesApple + - React-rendererdebug + - React-utils + - ReactCommon + - ReactNativeDependencies + - Yoga + - React-RCTImage (0.85.3): + - RCTTypeSafety + - React-Core-prebuilt + - React-Core/RCTImageHeaders + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - React-RCTNetwork + - ReactCommon + - ReactNativeDependencies + - React-RCTLinking (0.85.3): + - React-Core/RCTLinkingHeaders (= 0.85.3) + - React-jsi (= 0.85.3) + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - ReactCommon/turbomodule/core (= 0.85.3) + - React-RCTNetwork (0.85.3): + - RCTTypeSafety + - React-Core-prebuilt + - React-Core/RCTNetworkHeaders + - React-debug + - React-featureflags + - React-jsi + - React-jsinspectorcdp + - React-jsinspectornetwork + - React-NativeModulesApple + - React-networking + - React-RCTFBReactNativeSpec + - ReactCommon + - ReactNativeDependencies + - React-RCTRuntime (0.85.3): + - hermes-engine + - React-Core + - React-Core-prebuilt + - React-debug + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-jsitooling + - React-RuntimeApple + - React-RuntimeCore + - React-runtimeexecutor + - React-RuntimeHermes + - React-utils + - ReactNativeDependencies + - React-RCTSettings (0.85.3): + - RCTTypeSafety + - React-Core-prebuilt + - React-Core/RCTSettingsHeaders + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - ReactNativeDependencies + - React-RCTText (0.85.3): + - React-Core/RCTTextHeaders (= 0.85.3) + - Yoga + - React-RCTVibration (0.85.3): + - React-Core-prebuilt + - React-Core/RCTVibrationHeaders + - React-jsi + - React-NativeModulesApple + - React-RCTFBReactNativeSpec + - ReactCommon + - ReactNativeDependencies + - React-rendererconsistency (0.85.3) + - React-renderercss (0.85.3): + - React-debug + - React-utils + - React-rendererdebug (0.85.3): + - React-Core-prebuilt + - React-debug + - ReactNativeDependencies + - React-RuntimeApple (0.85.3): + - hermes-engine + - React-callinvoker + - React-Core-prebuilt + - React-Core/Default + - React-CoreModules + - React-cxxreact + - React-featureflags + - React-jserrorhandler + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsitooling + - React-Mapbuffer + - React-NativeModulesApple + - React-RCTFabric + - React-RCTFBReactNativeSpec + - React-RuntimeCore + - React-runtimeexecutor + - React-RuntimeHermes + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - React-RuntimeCore (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-cxxreact + - React-Fabric + - React-featureflags + - React-jserrorhandler + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-jsitooling + - React-performancetimeline + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactNativeDependencies + - React-runtimeexecutor (0.85.3): + - React-Core-prebuilt + - React-debug + - React-featureflags + - React-jsi (= 0.85.3) + - React-utils + - ReactNativeDependencies + - React-RuntimeHermes (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-featureflags + - React-hermes + - React-jsi + - React-jsinspector + - React-jsinspectorcdp + - React-jsinspectortracing + - React-jsitooling + - React-jsitracing + - React-RuntimeCore + - React-runtimeexecutor + - React-utils + - ReactNativeDependencies + - React-runtimescheduler (0.85.3): + - hermes-engine + - React-callinvoker + - React-Core-prebuilt + - React-cxxreact + - React-debug + - React-featureflags + - React-jsi + - React-jsinspectortracing + - React-performancetimeline + - React-rendererconsistency + - React-rendererdebug + - React-runtimeexecutor + - React-timing + - React-utils + - ReactNativeDependencies + - React-timing (0.85.3): + - React-debug + - React-utils (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-debug + - React-jsi (= 0.85.3) + - ReactNativeDependencies + - React-webperformancenativemodule (0.85.3): + - hermes-engine + - React-Core-prebuilt + - React-cxxreact + - React-jsi + - React-jsiexecutor + - React-performancetimeline + - React-RCTFBReactNativeSpec + - React-runtimeexecutor + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - ReactAppDependencyProvider (0.85.3): + - ReactCodegen + - ReactCodegen (0.85.3): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-debug + - React-Fabric + - React-FabricImage + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-NativeModulesApple + - React-RCTAppDelegate + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - ReactCommon (0.85.3): + - React-Core-prebuilt + - ReactCommon/turbomodule (= 0.85.3) + - ReactNativeDependencies + - ReactCommon/turbomodule (0.85.3): + - hermes-engine + - React-callinvoker (= 0.85.3) + - React-Core-prebuilt + - React-cxxreact (= 0.85.3) + - React-jsi (= 0.85.3) + - React-logger (= 0.85.3) + - React-perflogger (= 0.85.3) + - ReactCommon/turbomodule/bridging (= 0.85.3) + - ReactCommon/turbomodule/core (= 0.85.3) + - ReactNativeDependencies + - ReactCommon/turbomodule/bridging (0.85.3): + - hermes-engine + - React-callinvoker (= 0.85.3) + - React-Core-prebuilt + - React-cxxreact (= 0.85.3) + - React-jsi (= 0.85.3) + - React-logger (= 0.85.3) + - React-perflogger (= 0.85.3) + - ReactNativeDependencies + - ReactCommon/turbomodule/core (0.85.3): + - hermes-engine + - React-callinvoker (= 0.85.3) + - React-Core-prebuilt + - React-cxxreact (= 0.85.3) + - React-debug (= 0.85.3) + - React-featureflags (= 0.85.3) + - React-jsi (= 0.85.3) + - React-logger (= 0.85.3) + - React-perflogger (= 0.85.3) + - React-utils (= 0.85.3) + - ReactNativeDependencies + - ReactNativeDependencies (0.85.3) + - Yoga (0.0.0) + +DEPENDENCIES: + - FBLazyVector (from `../../../node_modules/react-native/Libraries/FBLazyVector`) + - hermes-engine (from `../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) + - NitroModules (from `../../../node_modules/react-native-nitro-modules`) + - NitroTest (from `../../../node_modules/react-native-nitro-test`) + - NitroTestExternal (from `../../../node_modules/react-native-nitro-test-external`) + - RCTDeprecation (from `../../../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`) + - RCTRequired (from `../../../node_modules/react-native/Libraries/Required`) + - RCTSwiftUI (from `../../../node_modules/react-native/ReactApple/RCTSwiftUI`) + - RCTSwiftUIWrapper (from `../../../node_modules/react-native/ReactApple/RCTSwiftUIWrapper`) + - RCTTypeSafety (from `../../../node_modules/react-native/Libraries/TypeSafety`) + - React (from `../../../node_modules/react-native/`) + - React-callinvoker (from `../../../node_modules/react-native/ReactCommon/callinvoker`) + - React-Core (from `../../../node_modules/react-native/`) + - React-Core-prebuilt (from `../../../node_modules/react-native/React-Core-prebuilt.podspec`) + - React-Core/RCTWebSocket (from `../../../node_modules/react-native/`) + - React-CoreModules (from `../../../node_modules/react-native/React/CoreModules`) + - React-cxxreact (from `../../../node_modules/react-native/ReactCommon/cxxreact`) + - React-debug (from `../../../node_modules/react-native/ReactCommon/react/debug`) + - React-defaultsnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/defaults`) + - React-domnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/dom`) + - React-Fabric (from `../../../node_modules/react-native/ReactCommon`) + - React-FabricComponents (from `../../../node_modules/react-native/ReactCommon`) + - React-FabricImage (from `../../../node_modules/react-native/ReactCommon`) + - React-featureflags (from `../../../node_modules/react-native/ReactCommon/react/featureflags`) + - React-featureflagsnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/featureflags`) + - React-graphics (from `../../../node_modules/react-native/ReactCommon/react/renderer/graphics`) + - React-hermes (from `../../../node_modules/react-native/ReactCommon/hermes`) + - React-idlecallbacksnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks`) + - React-ImageManager (from `../../../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios`) + - React-intersectionobservernativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/intersectionobserver`) + - React-jserrorhandler (from `../../../node_modules/react-native/ReactCommon/jserrorhandler`) + - React-jsi (from `../../../node_modules/react-native/ReactCommon/jsi`) + - React-jsiexecutor (from `../../../node_modules/react-native/ReactCommon/jsiexecutor`) + - React-jsinspector (from `../../../node_modules/react-native/ReactCommon/jsinspector-modern`) + - React-jsinspectorcdp (from `../../../node_modules/react-native/ReactCommon/jsinspector-modern/cdp`) + - React-jsinspectornetwork (from `../../../node_modules/react-native/ReactCommon/jsinspector-modern/network`) + - React-jsinspectortracing (from `../../../node_modules/react-native/ReactCommon/jsinspector-modern/tracing`) + - React-jsitooling (from `../../../node_modules/react-native/ReactCommon/jsitooling`) + - React-jsitracing (from `../../../node_modules/react-native/ReactCommon/hermes/executor/`) + - React-logger (from `../../../node_modules/react-native/ReactCommon/logger`) + - React-Mapbuffer (from `../../../node_modules/react-native/ReactCommon`) + - React-microtasksnativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`) + - React-mutationobservernativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/mutationobserver`) + - React-NativeModulesApple (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) + - React-networking (from `../../../node_modules/react-native/ReactCommon/react/networking`) + - React-oscompat (from `../../../node_modules/react-native/ReactCommon/oscompat`) + - React-perflogger (from `../../../node_modules/react-native/ReactCommon/reactperflogger`) + - React-performancecdpmetrics (from `../../../node_modules/react-native/ReactCommon/react/performance/cdpmetrics`) + - React-performancetimeline (from `../../../node_modules/react-native/ReactCommon/react/performance/timeline`) + - React-RCTActionSheet (from `../../../node_modules/react-native/Libraries/ActionSheetIOS`) + - React-RCTAnimation (from `../../../node_modules/react-native/Libraries/NativeAnimation`) + - React-RCTAppDelegate (from `../../../node_modules/react-native/Libraries/AppDelegate`) + - React-RCTBlob (from `../../../node_modules/react-native/Libraries/Blob`) + - React-RCTFabric (from `../../../node_modules/react-native/React`) + - React-RCTFBReactNativeSpec (from `../../../node_modules/react-native/React`) + - React-RCTImage (from `../../../node_modules/react-native/Libraries/Image`) + - React-RCTLinking (from `../../../node_modules/react-native/Libraries/LinkingIOS`) + - React-RCTNetwork (from `../../../node_modules/react-native/Libraries/Network`) + - React-RCTRuntime (from `../../../node_modules/react-native/React/Runtime`) + - React-RCTSettings (from `../../../node_modules/react-native/Libraries/Settings`) + - React-RCTText (from `../../../node_modules/react-native/Libraries/Text`) + - React-RCTVibration (from `../../../node_modules/react-native/Libraries/Vibration`) + - React-rendererconsistency (from `../../../node_modules/react-native/ReactCommon/react/renderer/consistency`) + - React-renderercss (from `../../../node_modules/react-native/ReactCommon/react/renderer/css`) + - React-rendererdebug (from `../../../node_modules/react-native/ReactCommon/react/renderer/debug`) + - React-RuntimeApple (from `../../../node_modules/react-native/ReactCommon/react/runtime/platform/ios`) + - React-RuntimeCore (from `../../../node_modules/react-native/ReactCommon/react/runtime`) + - React-runtimeexecutor (from `../../../node_modules/react-native/ReactCommon/runtimeexecutor`) + - React-RuntimeHermes (from `../../../node_modules/react-native/ReactCommon/react/runtime`) + - React-runtimescheduler (from `../../../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`) + - React-timing (from `../../../node_modules/react-native/ReactCommon/react/timing`) + - React-utils (from `../../../node_modules/react-native/ReactCommon/react/utils`) + - React-webperformancenativemodule (from `../../../node_modules/react-native/ReactCommon/react/nativemodule/webperformance`) + - ReactAppDependencyProvider (from `build/generated/ios/ReactAppDependencyProvider`) + - ReactCodegen (from `build/generated/ios/ReactCodegen`) + - ReactCommon/turbomodule/core (from `../../../node_modules/react-native/ReactCommon`) + - ReactNativeDependencies (from `../../../node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec`) + - Yoga (from `../../../node_modules/react-native/ReactCommon/yoga`) + +EXTERNAL SOURCES: + FBLazyVector: + :path: "../../../node_modules/react-native/Libraries/FBLazyVector" + hermes-engine: + :podspec: "../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" + :tag: hermes-v250829098.0.10 + NitroModules: + :path: "../../../node_modules/react-native-nitro-modules" + NitroTest: + :path: "../../../node_modules/react-native-nitro-test" + NitroTestExternal: + :path: "../../../node_modules/react-native-nitro-test-external" + RCTDeprecation: + :path: "../../../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation" + RCTRequired: + :path: "../../../node_modules/react-native/Libraries/Required" + RCTSwiftUI: + :path: "../../../node_modules/react-native/ReactApple/RCTSwiftUI" + RCTSwiftUIWrapper: + :path: "../../../node_modules/react-native/ReactApple/RCTSwiftUIWrapper" + RCTTypeSafety: + :path: "../../../node_modules/react-native/Libraries/TypeSafety" + React: + :path: "../../../node_modules/react-native/" + React-callinvoker: + :path: "../../../node_modules/react-native/ReactCommon/callinvoker" + React-Core: + :path: "../../../node_modules/react-native/" + React-Core-prebuilt: + :podspec: "../../../node_modules/react-native/React-Core-prebuilt.podspec" + React-CoreModules: + :path: "../../../node_modules/react-native/React/CoreModules" + React-cxxreact: + :path: "../../../node_modules/react-native/ReactCommon/cxxreact" + React-debug: + :path: "../../../node_modules/react-native/ReactCommon/react/debug" + React-defaultsnativemodule: + :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/defaults" + React-domnativemodule: + :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/dom" + React-Fabric: + :path: "../../../node_modules/react-native/ReactCommon" + React-FabricComponents: + :path: "../../../node_modules/react-native/ReactCommon" + React-FabricImage: + :path: "../../../node_modules/react-native/ReactCommon" + React-featureflags: + :path: "../../../node_modules/react-native/ReactCommon/react/featureflags" + React-featureflagsnativemodule: + :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/featureflags" + React-graphics: + :path: "../../../node_modules/react-native/ReactCommon/react/renderer/graphics" + React-hermes: + :path: "../../../node_modules/react-native/ReactCommon/hermes" + React-idlecallbacksnativemodule: + :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks" + React-ImageManager: + :path: "../../../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios" + React-intersectionobservernativemodule: + :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/intersectionobserver" + React-jserrorhandler: + :path: "../../../node_modules/react-native/ReactCommon/jserrorhandler" + React-jsi: + :path: "../../../node_modules/react-native/ReactCommon/jsi" + React-jsiexecutor: + :path: "../../../node_modules/react-native/ReactCommon/jsiexecutor" + React-jsinspector: + :path: "../../../node_modules/react-native/ReactCommon/jsinspector-modern" + React-jsinspectorcdp: + :path: "../../../node_modules/react-native/ReactCommon/jsinspector-modern/cdp" + React-jsinspectornetwork: + :path: "../../../node_modules/react-native/ReactCommon/jsinspector-modern/network" + React-jsinspectortracing: + :path: "../../../node_modules/react-native/ReactCommon/jsinspector-modern/tracing" + React-jsitooling: + :path: "../../../node_modules/react-native/ReactCommon/jsitooling" + React-jsitracing: + :path: "../../../node_modules/react-native/ReactCommon/hermes/executor/" + React-logger: + :path: "../../../node_modules/react-native/ReactCommon/logger" + React-Mapbuffer: + :path: "../../../node_modules/react-native/ReactCommon" + React-microtasksnativemodule: + :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks" + React-mutationobservernativemodule: + :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/mutationobserver" + React-NativeModulesApple: + :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios" + React-networking: + :path: "../../../node_modules/react-native/ReactCommon/react/networking" + React-oscompat: + :path: "../../../node_modules/react-native/ReactCommon/oscompat" + React-perflogger: + :path: "../../../node_modules/react-native/ReactCommon/reactperflogger" + React-performancecdpmetrics: + :path: "../../../node_modules/react-native/ReactCommon/react/performance/cdpmetrics" + React-performancetimeline: + :path: "../../../node_modules/react-native/ReactCommon/react/performance/timeline" + React-RCTActionSheet: + :path: "../../../node_modules/react-native/Libraries/ActionSheetIOS" + React-RCTAnimation: + :path: "../../../node_modules/react-native/Libraries/NativeAnimation" + React-RCTAppDelegate: + :path: "../../../node_modules/react-native/Libraries/AppDelegate" + React-RCTBlob: + :path: "../../../node_modules/react-native/Libraries/Blob" + React-RCTFabric: + :path: "../../../node_modules/react-native/React" + React-RCTFBReactNativeSpec: + :path: "../../../node_modules/react-native/React" + React-RCTImage: + :path: "../../../node_modules/react-native/Libraries/Image" + React-RCTLinking: + :path: "../../../node_modules/react-native/Libraries/LinkingIOS" + React-RCTNetwork: + :path: "../../../node_modules/react-native/Libraries/Network" + React-RCTRuntime: + :path: "../../../node_modules/react-native/React/Runtime" + React-RCTSettings: + :path: "../../../node_modules/react-native/Libraries/Settings" + React-RCTText: + :path: "../../../node_modules/react-native/Libraries/Text" + React-RCTVibration: + :path: "../../../node_modules/react-native/Libraries/Vibration" + React-rendererconsistency: + :path: "../../../node_modules/react-native/ReactCommon/react/renderer/consistency" + React-renderercss: + :path: "../../../node_modules/react-native/ReactCommon/react/renderer/css" + React-rendererdebug: + :path: "../../../node_modules/react-native/ReactCommon/react/renderer/debug" + React-RuntimeApple: + :path: "../../../node_modules/react-native/ReactCommon/react/runtime/platform/ios" + React-RuntimeCore: + :path: "../../../node_modules/react-native/ReactCommon/react/runtime" + React-runtimeexecutor: + :path: "../../../node_modules/react-native/ReactCommon/runtimeexecutor" + React-RuntimeHermes: + :path: "../../../node_modules/react-native/ReactCommon/react/runtime" + React-runtimescheduler: + :path: "../../../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler" + React-timing: + :path: "../../../node_modules/react-native/ReactCommon/react/timing" + React-utils: + :path: "../../../node_modules/react-native/ReactCommon/react/utils" + React-webperformancenativemodule: + :path: "../../../node_modules/react-native/ReactCommon/react/nativemodule/webperformance" + ReactAppDependencyProvider: + :path: build/generated/ios/ReactAppDependencyProvider + ReactCodegen: + :path: build/generated/ios/ReactCodegen + ReactCommon: + :path: "../../../node_modules/react-native/ReactCommon" + ReactNativeDependencies: + :podspec: "../../../node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec" + Yoga: + :path: "../../../node_modules/react-native/ReactCommon/yoga" + +SPEC CHECKSUMS: + FBLazyVector: 24e62c765683b8d89006a88a2c8f5cf019f0074d + hermes-engine: 648069fdb45f8d7b69565640981219abe1f7f1a9 + NitroModules: 8fea30a3c46ee50679d1828a71984ded6d4b83e5 + NitroTest: e8f08c86d71aaf14e74a32aa50d9362c4273f062 + NitroTestExternal: 716d373589a9fcb39cc05217288bdb59efe75c86 + RCTDeprecation: a4c521821fab57cbb125b36effe84d897d0dfa12 + RCTRequired: 9f3a7e5645d4bc3f551593de7550bb66ab6e42bc + RCTSwiftUI: 239ed2eb9e73de5a6f518810630f0c95e01c8702 + RCTSwiftUIWrapper: 966ca7f5f22ac0b2b2255fb09cffc381f5440b03 + RCTTypeSafety: 2a6403ba3492c04510e7c15bd635461646c43bb2 + React: e2dc35338068bbd299c66f043ae0d7f25de8499e + React-callinvoker: 28b25d21b124c26cebaea713ba7d801b9351dc48 + React-Core: 02ed7d2ffb70437bdf2aba074a13078a7b0b9ff0 + React-Core-prebuilt: 9811a9e65c837c032618d507a928a3d3dcf20721 + React-CoreModules: b3a5a42dadcde3b5d47b325bd912eb2ced89e146 + React-cxxreact: fe8f88dda044e5905e99a00f41b7a874c3908716 + React-debug: 92944dc4d89f56d640e75498266cbde557a48189 + React-defaultsnativemodule: cd64bc09d7ca24112bbaf1b91edbbcf3d81ea7dc + React-domnativemodule: dacf5bc055ae041039574f38b73a20b91e368774 + React-Fabric: bb0baa33d91839631d315800eb23e9aaa4338a44 + React-FabricComponents: c504d0b0e2f3054b2ba19af839f175cb361153c0 + React-FabricImage: 91eaea1cc58d25ae2596a9277bcfe028f92374c3 + React-featureflags: 5ac0455da0af12ca79b40402e2f42c5c7556b638 + React-featureflagsnativemodule: df7da181b064f10f5959a7cd529b5aab3686ecb2 + React-graphics: d25b1195baf24c7918543f4aff9be89cc080906f + React-hermes: 663286153a8ad6bf752b742654c766ff5e8991e7 + React-idlecallbacksnativemodule: 0bd5392cb67f1ab25df736814b7c05213b1d3c68 + React-ImageManager: a03eed3e3d4222130dc0ad503a1a5f3aa89de746 + React-intersectionobservernativemodule: 5d0f1c3c7b30031b0f6f730ee52dd9d607e2c966 + React-jserrorhandler: d5d6e7e20c5a2d6e8607e18d31d8712d7de676f6 + React-jsi: eb7cc4cffcf24796cc302d5b2bca0e92544139a9 + React-jsiexecutor: 65006f60e64c72c6b82f62ef6bd17c84846e73f8 + React-jsinspector: 01e32e2247b2486117fbb143db7f7717ef462c6d + React-jsinspectorcdp: f1cbb34ca41d188ba22efd9b663cf258a911f6cd + React-jsinspectornetwork: f61acc94c881c41451f508abfe6efa748b956c21 + React-jsinspectortracing: 9395894d9bd4d17931b9afcf230c0e7f4cb3d674 + React-jsitooling: 03ead841daa12a93b18479f5e400ceab3732d36d + React-jsitracing: 4ae61c79e14360d1c6ab566031c62c490da78439 + React-logger: bf149dea4343a9037b74bade36cced8b63f03f46 + React-Mapbuffer: fec3e025f0ffba6b32cd2a1d7bbdee3e269aae90 + React-microtasksnativemodule: ab33a818d339f5a1da308893c11b487be66121a8 + React-mutationobservernativemodule: a42d1626651ccd7d0dc02a56e69d4ec77c248893 + React-NativeModulesApple: deba264b03bd79c6bd61014fa30e40321b5e443a + React-networking: 35e6070b084f435429f85c5db40b4d5b38652fe9 + React-oscompat: 64a0c7ef5441855dc6e2a6afe8ba8f92aa05075e + React-perflogger: ca04287f205086a1edb5c95882be7b6068458889 + React-performancecdpmetrics: cf1d0a3178ccd59353cedcacbda421f40100a889 + React-performancetimeline: c9771212e7a43032d6f8d5edfb58280d46a7ce1f + React-RCTActionSheet: ab545c1e7b5f1ce4f8b40b6fa06afe2869095884 + React-RCTAnimation: 343147a9cd68c93d0ca280799fedfc7102d76ce4 + React-RCTAppDelegate: 5054754e92aaa9f8bfabe0f1022b84e46f3dcb57 + React-RCTBlob: 8c7ae3422ca4e72bc64b7a0142fd730efc5d4dfb + React-RCTFabric: be458db054b206c4d8e4f20f666e75d5f2c2d420 + React-RCTFBReactNativeSpec: 06db2e8d0f352d9fa23321aed1dd2cde25a3e83c + React-RCTImage: 481457bca63e039eb997f7d16c7560472f49657e + React-RCTLinking: 76cbb871240cec2dc5e7aa26c60f59e0ebbcf5a2 + React-RCTNetwork: e23a778225b7672e38545d3c5c24e1f4aad6d15f + React-RCTRuntime: 93c830b3ab3f7b494bbe7ae7289784f8b07b3947 + React-RCTSettings: 96196b535bef147381f96cc60ce9bda85d8be848 + React-RCTText: 749ebbd1a999fd84d80f37002ea3bf597fcea6df + React-RCTVibration: 5b41a7f274757c2928845981d970916ef9e4ca14 + React-rendererconsistency: 6708acd4bc39c1c5b00164370d0010d93b324c1f + React-renderercss: 80eb778756fed511d6128fc005188ac9008b0baf + React-rendererdebug: b46f338fb9d3f0bea6cf0621016c6c5a7a18e72e + React-RuntimeApple: c494b2089fad4a0c553cf63c2bb265f7eca2285d + React-RuntimeCore: b0bb151c3e2b26c6309d45d05c54aa65a6e0c094 + React-runtimeexecutor: 00b18635b6216a1708f6eb35dbadfd993ec91c7b + React-RuntimeHermes: bb44c4c574ce1b9507cad2e6be015344d18b94a9 + React-runtimescheduler: e1631e57209cb94b3efc29002b6a049cac3f6599 + React-timing: 356b88317ca60d373b0d94b6e7a71b0a572899f5 + React-utils: ccc01da318979af773259c4f6cdb1876f6f86f1a + React-webperformancenativemodule: f8b97c2cb6cfa94e92a503c09ad6d491c50a1390 + ReactAppDependencyProvider: 25c9c516839be2c5e3d3344f95dc7da5f7e63fc2 + ReactCodegen: aed05ddcaf34809080f0f4c2fcacab52b4af0a7d + ReactCommon: 7dfc3250793bf36cf221096ff59e1179e13eef7f + ReactNativeDependencies: 2f753e10bab2daefd70f93c7f52e6a50ebb23703 + Yoga: 77dfa8673de2874e1855002ae59c68b8be9b007b + +PODFILE CHECKSUM: fdb0427c5b39553664395712c604b36d821422d2 + +COCOAPODS: 1.16.2 diff --git a/apps/benchmark/metro.config.js b/apps/benchmark/metro.config.js new file mode 100644 index 0000000000..8bc79def06 --- /dev/null +++ b/apps/benchmark/metro.config.js @@ -0,0 +1,12 @@ +const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config') +const path = require('node:path') + +/** + * Metro configuration + * https://reactnative.dev/docs/metro + * + * @type {import('@react-native/metro-config').MetroConfig} + */ +const config = { watchFolders: [path.resolve(__dirname, '../..')] } + +module.exports = mergeConfig(getDefaultConfig(__dirname), config) diff --git a/apps/benchmark/package.json b/apps/benchmark/package.json new file mode 100644 index 0000000000..66ca4f7eba --- /dev/null +++ b/apps/benchmark/package.json @@ -0,0 +1,46 @@ +{ + "name": "react-native-nitro-benchmark", + "version": "0.37.1", + "private": true, + "scripts": { + "android": "react-native run-android --mode release", + "ios": "react-native run-ios --mode Release", + "build:android": "cd android && ./gradlew :app:assembleRelease --no-daemon", + "build:ios": "cd ios && xcodebuild -workspace NitroBenchmark.xcworkspace -scheme NitroBenchmark -configuration Release -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO", + "bundle-install": "bundle install", + "pods": "cd ios && bundle exec pod install", + "typecheck": "tsc --noEmit", + "lint": "eslint \"**/*.{js,ts,tsx}\" --fix", + "lint-ci": "eslint \"**/*.{js,ts,tsx}\" -f @jamesacarr/github-actions --max-warnings 0" + }, + "dependencies": { + "react": "19.2.3", + "react-native": "0.85.3", + "react-native-nitro-modules": "*", + "react-native-nitro-test": "*", + "react-native-nitro-test-external": "*" + }, + "devDependencies": { + "@babel/core": "^7.29.7", + "@babel/preset-env": "^7.29.7", + "@babel/runtime": "^7.29.7", + "@react-native-community/cli": "20.1.3", + "@react-native-community/cli-platform-android": "20.1.3", + "@react-native-community/cli-platform-ios": "20.1.3", + "@react-native/babel-preset": "0.85.3", + "@react-native/eslint-config": "0.85.3", + "@react-native/metro-config": "0.85.3", + "@react-native/typescript-config": "0.85.3" + }, + "engines": { + "node": ">=20.19.4" + }, + "codegenConfig": { + "name": "ExampleTurboModule", + "type": "modules", + "jsSrcsDir": "src/turbo-module", + "android": { + "javaPackageName": "com.nitroexample.exampleturbomodule" + } + } +} diff --git a/apps/benchmark/src/benchmarks/BenchmarkApp.tsx b/apps/benchmark/src/benchmarks/BenchmarkApp.tsx new file mode 100644 index 0000000000..6132d935b4 --- /dev/null +++ b/apps/benchmark/src/benchmarks/BenchmarkApp.tsx @@ -0,0 +1,161 @@ +import * as React from 'react' +import { StyleSheet, Text, View } from 'react-native' +import { + assertReleaseBenchmarkEnvironment, + createBenchmarkSuite, + getBenchmarkEnvironment, + runBenchmarkDefinitions, + type BenchmarkRunConfiguration, + type BenchmarkRunResult, + type BenchmarkRunnerOptions, +} from './index' + +const CONTROLLER_URL = 'http://127.0.0.1:8173' +const RUNNER_OPTIONS: Omit = { + targetBatchDurationMs: 150, + warmupCount: 5, + sampleCount: 20, +} + +function isRunConfiguration( + value: unknown +): value is BenchmarkRunConfiguration { + if (value == null || typeof value !== 'object') return false + const candidate = value as Partial + return ( + typeof candidate.runId === 'string' && + typeof candidate.reverse === 'boolean' && + typeof candidate.commitSha === 'string' && + typeof candidate.suiteHash === 'string' && + (candidate.platform === 'android' || candidate.platform === 'ios') && + typeof candidate.device === 'string' && + typeof candidate.osVersion === 'string' && + typeof candidate.architecture === 'string' && + typeof candidate.toolchain === 'string' && + (candidate.benchmarkIndex === undefined || + (Number.isInteger(candidate.benchmarkIndex) && + candidate.benchmarkIndex >= 0)) + ) +} + +async function waitForRuntimeToSettle(): Promise { + await new Promise((resolve) => { + requestAnimationFrame(() => requestAnimationFrame(() => resolve())) + }) + await new Promise((resolve) => setTimeout(resolve, 1_000)) +} + +async function readConfiguration(): Promise { + const response = await fetch(`${CONTROLLER_URL}/config`) + if (!response.ok) { + throw new Error(`Controller returned HTTP ${response.status}.`) + } + const value: unknown = await response.json() + if (!isRunConfiguration(value)) { + throw new Error('Controller returned an invalid benchmark configuration.') + } + return value +} + +async function postJson(path: string, value: unknown): Promise { + const response = await fetch(`${CONTROLLER_URL}${path}`, { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify(value), + }) + if (!response.ok) { + throw new Error(`Controller returned HTTP ${response.status}.`) + } +} + +async function run(): Promise { + const configuration = await readConfiguration() + const environment = getBenchmarkEnvironment() + assertReleaseBenchmarkEnvironment(environment) + await waitForRuntimeToSettle() + + const startedAt = new Date().toISOString() + const start = performance.now() + const suite = createBenchmarkSuite() + const ordered = configuration.reverse ? [...suite].reverse() : suite + const selected = + configuration.benchmarkIndex === undefined + ? suite + : ordered.slice( + configuration.benchmarkIndex, + configuration.benchmarkIndex + 1 + ) + if (selected.length === 0) + throw new Error('Requested benchmark index is outside the suite.') + const metrics = await runBenchmarkDefinitions(selected, { + ...RUNNER_OPTIONS, + reverse: configuration.reverse, + }) + + return { + schemaVersion: 1, + suiteVersion: 1, + configuration, + environment, + runner: RUNNER_OPTIONS, + startedAt, + durationMs: performance.now() - start, + metrics, + benchmarkCount: suite.length, + } +} + +export function BenchmarkApp() { + const [status, setStatus] = React.useState('Preparing Release benchmarks…') + + React.useEffect(() => { + let active = true + const execute = async () => { + try { + const result = await run() + await postJson('/result', result) + if (active) setStatus('Benchmarks complete.') + } catch (error) { + const message = error instanceof Error ? error.message : String(error) + try { + await postJson('/error', { message }) + } catch { + // The host-side timeout will report a controller connection failure. + } + if (active) setStatus(`Benchmark failed: ${message}`) + } + } + execute() + return () => { + active = false + } + }, []) + + return ( + + Nitro Performance + {status} + + ) +} + +const styles = StyleSheet.create({ + container: { + alignItems: 'center', + backgroundColor: '#0b0b0f', + flex: 1, + justifyContent: 'center', + padding: 24, + }, + title: { + color: '#ffffff', + fontSize: 28, + fontWeight: '700', + marginBottom: 16, + }, + status: { + color: '#b8b8c3', + fontSize: 16, + textAlign: 'center', + }, +}) diff --git a/apps/benchmark/src/benchmarks/batch.ts b/apps/benchmark/src/benchmarks/batch.ts new file mode 100644 index 0000000000..7e8943d04f --- /dev/null +++ b/apps/benchmark/src/benchmarks/batch.ts @@ -0,0 +1,73 @@ +import type { BenchmarkDefinition } from './types' + +export interface BenchmarkRuntime { + collectGarbage(): void + yieldToRuntime(): Promise +} + +export const benchmarkRuntime: BenchmarkRuntime = { + collectGarbage() { + // Hermes exposes this in Release too; never silently omit memory cleanup. + const gc = (globalThis as { gc?: () => void }).gc + if (gc == null) throw new Error('Benchmark runtime requires Hermes gc().') + gc() + }, + // RCTTiming immediately re-enqueues zero-delay timers. A positive delay goes + // through its next-frame path, allowing the native run loop/pools to drain. + yieldToRuntime: () => new Promise((resolve) => setTimeout(resolve, 1)), +} + +export async function executeBatch( + definition: BenchmarkDefinition, + iterations: number, + runtime: BenchmarkRuntime +): Promise<{ durationMs: number; checksum: number }> { + const chunkIterations = Math.min( + iterations, + definition.maxChunkIterations ?? iterations + ) + if (!Number.isSafeInteger(chunkIterations) || chunkIterations < 1) { + throw new Error(`Benchmark ${definition.id} has an invalid chunk size.`) + } + let durationMs = 0 + let checksum = 0 + let chunksSinceYield = 0 + runtime.collectGarbage() + definition.collectNativeGarbage?.() + for ( + let remaining = iterations; + remaining > 0; + remaining -= chunkIterations + ) { + const count = Math.min(remaining, chunkIterations) + const start = performance.now() + const result = + definition.kind === 'async' + ? await definition.run(count) + : definition.run(count) + const elapsed = performance.now() - start + + // Timing stops before checksum validation and explicit garbage collection. + if (!Number.isFinite(result) || !Number.isFinite(elapsed) || elapsed < 0) { + throw new Error(`Benchmark ${definition.id} produced an invalid sample.`) + } + const expected = definition.expectedChecksum(count) + if (result !== expected) { + throw new Error( + `Benchmark ${definition.id} returned checksum ${result}, expected ${expected}.` + ) + } + durationMs += elapsed + checksum += result + runtime.collectGarbage() + definition.collectNativeGarbage?.() + // Drain native autorelease pools/cleaners after at most four bounded chunks. + // A native timer yield can cost a frame; do not pay it for every tiny chunk. + chunksSinceYield++ + if (chunksSinceYield === 4 || remaining <= chunkIterations) { + await runtime.yieldToRuntime() + chunksSinceYield = 0 + } + } + return { durationMs, checksum } +} diff --git a/apps/benchmark/src/benchmarks/calibration.ts b/apps/benchmark/src/benchmarks/calibration.ts new file mode 100644 index 0000000000..2a622bb7ea --- /dev/null +++ b/apps/benchmark/src/benchmarks/calibration.ts @@ -0,0 +1,43 @@ +const MAX_CALIBRATION_STEPS = 24 + +/** Two significant digits: e.g. 1,500,000, 240,000 or 3,200 operations. */ +export function roundIterations(value: number, maximum: number): number { + const bounded = Math.max(1, Math.min(maximum, value)) + const step = 10 ** Math.max(0, Math.floor(Math.log10(bounded)) - 1) + return Math.max(1, Math.min(maximum, Math.round(bounded / step) * step)) +} + +export async function calibrateIterations( + measure: (iterations: number) => Promise, + targetMs: number, + initialIterations = 1_000, + maximum = 100_000_000 +): Promise { + let iterations = roundIterations(initialIterations, maximum) + let confirmations = 0 + for (let step = 0; step < MAX_CALIBRATION_STEPS; step++) { + const durationMs = await measure(iterations) + if (!Number.isFinite(durationMs) || durationMs < 0) { + throw new Error('Calibration requires a finite, non-negative duration.') + } + // Aim inside the requested 100–200 ms window, leaving room for drift. + if (durationMs >= targetMs * 0.8 && durationMs <= targetMs * 1.2) { + if (++confirmations === 2) return iterations + continue + } + confirmations = 0 + if (iterations === maximum && durationMs < targetMs * 0.8) { + throw new Error('Iteration limit prevents a sufficiently long batch.') + } + if (iterations === 1 && durationMs > targetMs * 1.2) { + throw new Error('One operation exceeds the target batch duration.') + } + // Unlike the old calibration, also shrink an overshooting batch. + const scale = durationMs === 0 ? 10 : targetMs / durationMs + iterations = roundIterations( + iterations * Math.max(0.1, Math.min(10, scale)), + maximum + ) + } + throw new Error('Batch duration did not stabilize during calibration.') +} diff --git a/apps/benchmark/src/benchmarks/environment.ts b/apps/benchmark/src/benchmarks/environment.ts new file mode 100644 index 0000000000..eeaead1555 --- /dev/null +++ b/apps/benchmark/src/benchmarks/environment.ts @@ -0,0 +1,35 @@ +import { Platform } from 'react-native' +import { NitroModules } from 'react-native-nitro-modules' +import type { BenchmarkRunEnvironment } from './types' + +declare const __DEV__: boolean + +function reactNativeVersion(): string { + const version = Platform.constants.reactNativeVersion + return `${version.major}.${version.minor}.${version.patch}` +} + +export function getBenchmarkEnvironment(): BenchmarkRunEnvironment { + return { + reactNativeVersion: reactNativeVersion(), + hermes: HermesInternal != null, + dev: __DEV__, + nitroBuildType: NitroModules.buildType, + } +} + +export function assertReleaseBenchmarkEnvironment( + environment: BenchmarkRunEnvironment +): void { + if (environment.dev) { + throw new Error('Performance benchmarks require __DEV__ === false.') + } + if (!environment.hermes) { + throw new Error('Performance benchmarks require the Hermes runtime.') + } + if (environment.nitroBuildType !== 'release') { + throw new Error( + `Performance benchmarks require a release Nitro build, got ${environment.nitroBuildType}.` + ) + } +} diff --git a/apps/benchmark/src/benchmarks/index.ts b/apps/benchmark/src/benchmarks/index.ts new file mode 100644 index 0000000000..b9a7797e4f --- /dev/null +++ b/apps/benchmark/src/benchmarks/index.ts @@ -0,0 +1,12 @@ +export { createBenchmarkSuite } from './suite' +export { runBenchmarkDefinitions } from './runner' +export { + assertReleaseBenchmarkEnvironment, + getBenchmarkEnvironment, +} from './environment' +export type { + BenchmarkMetric, + BenchmarkRunConfiguration, + BenchmarkRunResult, + BenchmarkRunnerOptions, +} from './types' diff --git a/apps/benchmark/src/benchmarks/runner.ts b/apps/benchmark/src/benchmarks/runner.ts new file mode 100644 index 0000000000..169f7ec880 --- /dev/null +++ b/apps/benchmark/src/benchmarks/runner.ts @@ -0,0 +1,101 @@ +import { + bootstrapMedianConfidenceInterval, + median, + medianAbsoluteDeviation, + quantile, + robustCoefficientOfVariationPercent, +} from './statistics' +import { calibrateIterations, roundIterations } from './calibration' +import { benchmarkRuntime, executeBatch, type BenchmarkRuntime } from './batch' +import type { + BenchmarkDefinition, + BenchmarkMetric, + BenchmarkRunnerOptions, +} from './types' + +export async function runBenchmarkDefinitions( + definitions: readonly BenchmarkDefinition[], + options: BenchmarkRunnerOptions, + runtime: BenchmarkRuntime = benchmarkRuntime +): Promise { + const ordered = options.reverse + ? [...definitions].reverse() + : [...definitions] + const metrics: BenchmarkMetric[] = [] + + for (const definition of ordered) { + let iterations = definition.initialIterations ?? 1_000 + let checksum = 0 + for (let attempt = 0; attempt < 3; attempt++) { + iterations = await calibrateIterations( + async (count) => + (await executeBatch(definition, count, runtime)).durationMs, + options.targetBatchDurationMs, + iterations, + definition.maxIterations + ) + checksum = 0 + const warmupDurations: number[] = [] + for (let index = 0; index < options.warmupCount; index++) { + const warmup = await executeBatch(definition, iterations, runtime) + checksum += warmup.checksum + warmupDurations.push(warmup.durationMs) + } + const warmupMedian = median(warmupDurations) + if ( + warmupMedian >= options.targetBatchDurationMs * (2 / 3) && + warmupMedian <= options.targetBatchDurationMs * (4 / 3) + ) + break + if (attempt === 2) { + throw new Error( + `Benchmark ${definition.id} did not stabilize after warmup.` + ) + } + iterations = roundIterations( + (iterations * options.targetBatchDurationMs) / warmupMedian, + definition.maxIterations ?? 100_000_000 + ) + } + + // Freeze the count for all measured samples. Do not discard slow samples + // or tune iterations from measured results: that would bias the comparison. + const samplesNsPerOp = new Array(options.sampleCount) + for (let index = 0; index < options.sampleCount; index++) { + const sample = await executeBatch(definition, iterations, runtime) + checksum += sample.checksum + samplesNsPerOp[index] = (sample.durationMs * 1_000_000) / iterations + } + + const metric: BenchmarkMetric = { + id: definition.id, + version: definition.version, + family: definition.family, + implementation: definition.implementation, + advisory: definition.advisory ?? false, + iterations, + chunkIterations: Math.min( + iterations, + definition.maxChunkIterations ?? iterations + ), + samplesNsPerOp, + medianNsPerOp: median(samplesNsPerOp), + p95NsPerOp: quantile(samplesNsPerOp, 0.95), + medianAbsoluteDeviationNsPerOp: medianAbsoluteDeviation(samplesNsPerOp), + robustCoefficientOfVariationPercent: + robustCoefficientOfVariationPercent(samplesNsPerOp), + medianConfidenceInterval95: bootstrapMedianConfidenceInterval( + samplesNsPerOp, + 2_000, + definition.id + ), + checksum, + } + metrics.push(metric) + console.info( + `[NitroBenchmark] ${metric.id}: ${metric.medianNsPerOp.toFixed(2)} ns/op; ${iterations} ops/sample, chunks of ${metric.chunkIterations}, median timed batch ${((metric.medianNsPerOp * iterations) / 1_000_000).toFixed(1)} ms` + ) + } + + return metrics +} diff --git a/apps/benchmark/src/benchmarks/statistics.ts b/apps/benchmark/src/benchmarks/statistics.ts new file mode 100644 index 0000000000..13b9488cec --- /dev/null +++ b/apps/benchmark/src/benchmarks/statistics.ts @@ -0,0 +1,102 @@ +function sorted(values: readonly number[]): number[] { + return [...values].sort((left, right) => left - right) +} + +export function quantile( + values: readonly number[], + percentile: number +): number { + if (values.length === 0) { + throw new Error('Cannot calculate a quantile for an empty sample.') + } + if (percentile < 0 || percentile > 1) { + throw new Error(`Percentile must be between 0 and 1, got ${percentile}.`) + } + + const ordered = sorted(values) + const position = (ordered.length - 1) * percentile + const lowerIndex = Math.floor(position) + const upperIndex = Math.ceil(position) + const lower = ordered[lowerIndex]! + const upper = ordered[upperIndex]! + return lower + (upper - lower) * (position - lowerIndex) +} + +export function median(values: readonly number[]): number { + return quantile(values, 0.5) +} + +export function medianAbsoluteDeviation(values: readonly number[]): number { + const center = median(values) + return median(values.map((value) => Math.abs(value - center))) +} + +export function robustCoefficientOfVariationPercent( + values: readonly number[] +): number { + const center = median(values) + if (center === 0) return 0 + return (1.4826 * medianAbsoluteDeviation(values) * 100) / center +} + +function hashSeed(seed: string): number { + let value = 17 + for (let index = 0; index < seed.length; index++) { + value = (value * 31 + seed.charCodeAt(index)) % 2_147_483_647 + } + return value +} + +function createRandom(seed: string): () => number { + let state = hashSeed(seed) || 1 + return () => { + state = (state * 48_271) % 2_147_483_647 + return state / 2_147_483_647 + } +} + +function resampleMedian( + values: readonly number[], + random: () => number +): number { + const sample = new Array(values.length) + for (let index = 0; index < values.length; index++) { + sample[index] = values[Math.floor(random() * values.length)]! + } + return median(sample) +} + +export function bootstrapMedianConfidenceInterval( + values: readonly number[], + iterations: number, + seed: string +): [number, number] { + if (iterations < 1) { + throw new Error('Bootstrap iterations must be positive.') + } + const random = createRandom(seed) + const medians = new Array(iterations) + for (let index = 0; index < iterations; index++) { + medians[index] = resampleMedian(values, random) + } + return [quantile(medians, 0.025), quantile(medians, 0.975)] +} + +export function bootstrapPercentChangeConfidenceInterval( + base: readonly number[], + head: readonly number[], + iterations: number, + seed: string +): [number, number] { + if (base.length === 0 || head.length === 0) { + throw new Error('Both base and head samples are required.') + } + const random = createRandom(seed) + const changes = new Array(iterations) + for (let index = 0; index < iterations; index++) { + const baseMedian = resampleMedian(base, random) + const headMedian = resampleMedian(head, random) + changes[index] = (headMedian / baseMedian - 1) * 100 + } + return [quantile(changes, 0.025), quantile(changes, 0.975)] +} diff --git a/apps/benchmark/src/benchmarks/suite.ts b/apps/benchmark/src/benchmarks/suite.ts new file mode 100644 index 0000000000..132b1297e3 --- /dev/null +++ b/apps/benchmark/src/benchmarks/suite.ts @@ -0,0 +1,459 @@ +import { + HybridTestObjectCpp, + HybridTestObjectSwiftKotlin, + type Car, + type TestObjectCpp, + type TestObjectSwiftKotlin, +} from 'react-native-nitro-test' +import { Platform } from 'react-native' +import { ExampleTurboModule } from '../turbo-module/ExampleTurboModule' +import type { BenchmarkDefinition, BenchmarkImplementation } from './types' + +type TestObject = TestObjectCpp | TestObjectSwiftKotlin + +const smallNumbers = Array.from({ length: 16 }, (_, index) => index + 1) +const largeNumbers = Array.from({ length: 1024 }, (_, index) => index + 1) +const smallBuffer = new ArrayBuffer(4 * 1024) +const largeBuffer = new ArrayBuffer(1024 * 1024) + +const car: Car = { + year: 2026, + make: 'Margelo', + model: 'Nitro', + power: 900, + powertrain: 'electric', + driver: { name: 'Marc', age: 30 }, + passengers: [ + { name: 'Ada', age: 36 }, + { name: 'Grace', age: 40 }, + ], + isFast: true, + favouriteTrack: 'Spa-Francorchamps', + performanceScores: [9.8, 9.9, 10], + someVariant: 'fast', +} + +const typedMap: Record = { + zero: 0, + one: 1, + two: 2, + three: 3, + four: 4, + five: 5, + six: 6, + seven: 7, +} + +function assertNumber(value: number, label: string): number { + if (!Number.isFinite(value)) { + throw new Error(`${label} returned a non-finite checksum.`) + } + return value +} + +function sumFromOne(count: number): number { + return (count * (count + 1)) / 2 +} + +function sumFromZero(count: number): number { + return (count * (count - 1)) / 2 +} + +function repeatedSequenceSum(iterations: number, length: number): number { + const completeSequences = Math.floor(iterations / length) + const remainder = iterations % length + return completeSequences * sumFromOne(length) + sumFromOne(remainder) +} + +function addNumbersChecksum(iterations: number): number { + return repeatedSequenceSum(iterations, 1_000) + iterations * 2 +} + +function variantChecksum(iterations: number): number { + const evenCount = Math.ceil(iterations / 2) + const oddCount = Math.floor(iterations / 2) + return evenCount * (evenCount - 1) + oddCount * 'nitro'.length +} + +function collectJavaGarbage(): void { + if (!ExampleTurboModule.collectGarbage()) + throw new Error('Java heap cleanup failed.') +} + +function createObjectBenchmarks( + object: TestObject, + implementation: BenchmarkImplementation +): BenchmarkDefinition[] { + const prefix = implementation + const synchronousCallback = () => 1 + return [ + { + id: `${prefix}/primitive/simple-func`, + version: 2, + family: 'primitive', + implementation, + kind: 'sync', + expectedChecksum: sumFromOne, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + object.simpleFunc() + checksum += index + 1 + } + return assertNumber(checksum, 'simpleFunc') + }, + }, + { + id: `${prefix}/primitive/add-numbers`, + version: 2, + family: 'primitive', + implementation, + kind: 'sync', + expectedChecksum: addNumbersChecksum, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += object.addNumbers(index % 1_000, 3) + } + return assertNumber(checksum, 'addNumbers') + }, + }, + { + id: `${prefix}/property/number-get-set`, + version: 2, + family: 'property', + implementation, + kind: 'sync', + expectedChecksum: sumFromZero, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + object.numberValue = index + checksum += object.numberValue + } + return assertNumber(checksum, 'numberValue') + }, + }, + { + id: `${prefix}/string/ascii-short`, + version: 2, + family: 'string', + implementation, + kind: 'sync', + maxChunkIterations: 50_000, + expectedChecksum: (iterations) => iterations * 12, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += object.addStrings('Nitro', 'Modules').length + } + return assertNumber(checksum, 'addStrings ASCII') + }, + }, + { + id: `${prefix}/string/unicode`, + version: 2, + family: 'string', + implementation, + kind: 'sync', + maxChunkIterations: 50_000, + expectedChecksum: (iterations) => iterations * 10, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += object.addStrings('🚀γειά', '世界🧪').length + } + return assertNumber(checksum, 'addStrings Unicode') + }, + }, + createArrayBenchmark(object, implementation, 'small-16', smallNumbers), + createArrayBenchmark(object, implementation, 'large-1024', largeNumbers), + { + id: `${prefix}/struct/nested-car`, + version: 2, + family: 'struct', + implementation, + kind: 'sync', + maxChunkIterations: 5_000, + expectedChecksum: (iterations) => iterations * 902, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + const result = object.bounceCar(car) + checksum += result.power + result.passengers.length + } + return assertNumber(checksum, 'bounceCar') + }, + }, + { + id: `${prefix}/map/typed-eight-entries`, + version: 2, + family: 'map', + implementation, + kind: 'sync', + maxChunkIterations: 5_000, + expectedChecksum: (iterations) => iterations * 7, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += object.bounceSimpleMap(typedMap).seven ?? 0 + } + return assertNumber(checksum, 'bounceSimpleMap') + }, + }, + { + id: `${prefix}/optional/trailing-string`, + version: 2, + family: 'optional', + implementation, + kind: 'sync', + maxChunkIterations: 50_000, + expectedChecksum: (iterations) => + Math.ceil(iterations / 2) * 5 + Math.floor(iterations / 2) * 14, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + const result = object.tryOptionalParams( + index, + true, + index % 2 === 0 ? 'nitro' : undefined + ) + checksum += result.length + } + return assertNumber(checksum, 'tryOptionalParams') + }, + }, + { + id: `${prefix}/variant/number-or-string`, + version: 2, + family: 'variant', + implementation, + kind: 'sync', + maxChunkIterations: 50_000, + expectedChecksum: variantChecksum, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + const result = object.passVariant(index % 2 === 0 ? index : 'nitro') + checksum += typeof result === 'number' ? result : result.length + } + return assertNumber(checksum, 'passVariant') + }, + }, + { + id: `${prefix}/hybrid-object/create`, + version: 2, + family: 'hybrid-object', + implementation, + kind: 'sync', + // Bound live JVM references; the runner collects between timed chunks + // and accumulates enough chunks for a full ~150 ms measured sample. + maxChunkIterations: 5_000, + expectedChecksum: sumFromOne, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += object.newTestObject().addNumbers(index, 1) + } + return assertNumber(checksum, 'newTestObject') + }, + }, + { + id: `${prefix}/hybrid-object/return-existing`, + version: 2, + family: 'hybrid-object', + implementation, + kind: 'sync', + maxChunkIterations: 50_000, + expectedChecksum: sumFromOne, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += object.thisObject.addNumbers(index, 1) + } + return assertNumber(checksum, 'thisObject') + }, + }, + createBufferBenchmark( + object, + implementation, + 'bounce-4-kib', + smallBuffer, + 'bounce' + ), + createBufferBenchmark( + object, + implementation, + 'bounce-1-mib', + largeBuffer, + 'bounce' + ), + createBufferBenchmark( + object, + implementation, + 'copy-4-kib', + smallBuffer, + 'copy' + ), + createBufferBenchmark( + object, + implementation, + 'copy-1-mib', + largeBuffer, + 'copy' + ), + { + id: `${prefix}/callback/synchronous`, + version: 2, + family: 'callback', + implementation, + kind: 'sync', + maxChunkIterations: 50_000, + expectedChecksum: (iterations) => iterations, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += object.callbackSync(synchronousCallback) + } + return assertNumber(checksum, 'callbackSync') + }, + }, + { + id: `${prefix}/promise/immediate`, + version: 2, + family: 'promise', + implementation, + kind: 'async', + advisory: true, + // Release fulfilled Promise chains between chunks, outside the timer. + maxChunkIterations: 5_000, + collectNativeGarbage: + implementation === 'nitro-platform' && Platform.OS === 'android' + ? collectJavaGarbage + : undefined, + expectedChecksum: (iterations) => iterations * 55, + async run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += await object.promiseReturnsInstantly() + } + return assertNumber(checksum, 'promiseReturnsInstantly') + }, + }, + ] +} + +function createArrayBenchmark( + object: TestObject, + implementation: BenchmarkImplementation, + name: string, + input: number[] +): BenchmarkDefinition { + return { + id: `${implementation}/array/${name}`, + version: 2, + family: 'array', + implementation, + kind: 'sync', + maxChunkIterations: input.length >= 1_024 ? 1_000 : 10_000, + expectedChecksum: (iterations) => + repeatedSequenceSum(iterations, input.length), + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + const result = object.bounceNumbers(input) + checksum += result[index % result.length] ?? 0 + } + return assertNumber(checksum, `bounceNumbers ${name}`) + }, + } +} + +function createBufferBenchmark( + object: TestObject, + implementation: BenchmarkImplementation, + name: string, + input: ArrayBuffer, + operation: 'bounce' | 'copy' +): BenchmarkDefinition { + // Android direct ByteBuffers use ART's non-moving heap. Leave room for the + // Java/HybridData cleaner stages as well as Hermes GC. Collect both heaps + // between bounded copy chunks; cleanup is not part of the copy measurement. + const javaBuffer = + implementation === 'nitro-platform' && Platform.OS === 'android' + return { + id: `${implementation}/array-buffer/${name}`, + version: 2, + family: 'array-buffer', + implementation, + kind: 'sync', + // Bounce does not copy the payload; its chunk bound is independent of size. + maxChunkIterations: + operation === 'bounce' + ? 50_000 + : input.byteLength >= 1024 * 1024 + ? javaBuffer + ? 10 + : 50 + : 5_000, + collectNativeGarbage: + javaBuffer && operation === 'copy' ? collectJavaGarbage : undefined, + expectedChecksum: (iterations) => + input.byteLength * iterations + Math.floor(iterations / 2), + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + const result = + operation === 'bounce' + ? object.bounceArrayBuffer(input) + : object.copyBuffer(input) + checksum += result.byteLength + (index % 2) + } + return assertNumber(checksum, `${operation}Buffer ${name}`) + }, + } +} + +export function createBenchmarkSuite(): BenchmarkDefinition[] { + const javascript = { + addNumbers: (left: number, right: number) => left + right, + } + const controls: BenchmarkDefinition[] = [ + { + id: 'javascript/control/add-numbers', + version: 2, + family: 'control', + implementation: 'javascript', + kind: 'sync', + expectedChecksum: addNumbersChecksum, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += javascript.addNumbers(index % 1_000, 3) + } + return assertNumber(checksum, 'JavaScript addNumbers') + }, + }, + { + id: 'turbo-module/control/add-numbers', + version: 2, + family: 'control', + implementation: 'turbo-module', + kind: 'sync', + expectedChecksum: addNumbersChecksum, + run(iterations) { + let checksum = 0 + for (let index = 0; index < iterations; index++) { + checksum += ExampleTurboModule.addNumbers(index % 1_000, 3) + } + return assertNumber(checksum, 'TurboModule addNumbers') + }, + }, + ] + + return [ + ...controls, + ...createObjectBenchmarks(HybridTestObjectCpp, 'nitro-cpp'), + ...createObjectBenchmarks(HybridTestObjectSwiftKotlin, 'nitro-platform'), + ] +} diff --git a/apps/benchmark/src/benchmarks/types.ts b/apps/benchmark/src/benchmarks/types.ts new file mode 100644 index 0000000000..281185928f --- /dev/null +++ b/apps/benchmark/src/benchmarks/types.ts @@ -0,0 +1,108 @@ +export type BenchmarkImplementation = + | 'javascript' + | 'turbo-module' + | 'nitro-cpp' + | 'nitro-platform' + +export type BenchmarkFamily = + | 'control' + | 'primitive' + | 'property' + | 'string' + | 'array' + | 'struct' + | 'map' + | 'optional' + | 'variant' + | 'hybrid-object' + | 'array-buffer' + | 'callback' + | 'promise' + +interface BenchmarkDefinitionBase { + id: string + version: number + family: BenchmarkFamily + implementation: BenchmarkImplementation + advisory?: boolean + initialIterations?: number + maxIterations?: number + /** Bound live allocations, not the total operations in a measured sample. */ + maxChunkIterations?: number + /** Additional native-heap cleanup after Hermes GC, outside measured time. */ + collectNativeGarbage?(): void + expectedChecksum(iterations: number): number +} + +export interface SyncBenchmarkDefinition extends BenchmarkDefinitionBase { + kind: 'sync' + run(iterations: number): number +} + +export interface AsyncBenchmarkDefinition extends BenchmarkDefinitionBase { + kind: 'async' + run(iterations: number): Promise +} + +export type BenchmarkDefinition = + | SyncBenchmarkDefinition + | AsyncBenchmarkDefinition + +export interface BenchmarkRunnerOptions { + targetBatchDurationMs: number + warmupCount: number + sampleCount: number + reverse: boolean +} + +export interface BenchmarkMetric { + id: string + version: number + family: BenchmarkFamily + implementation: BenchmarkImplementation + advisory: boolean + iterations: number + /** Maximum operations between untimed garbage collections. */ + chunkIterations: number + samplesNsPerOp: number[] + medianNsPerOp: number + p95NsPerOp: number + medianAbsoluteDeviationNsPerOp: number + robustCoefficientOfVariationPercent: number + medianConfidenceInterval95: [number, number] + checksum: number +} + +export interface BenchmarkRunConfiguration { + /** Select one case in suite order for a fresh-process measurement. */ + benchmarkIndex?: number + runId: string + reverse: boolean + commitSha: string + suiteHash: string + platform: 'android' | 'ios' + device: string + osVersion: string + architecture: string + toolchain: string +} + +export interface BenchmarkRunEnvironment { + reactNativeVersion: string + hermes: boolean + dev: boolean + nitroBuildType: 'debug' | 'release' +} + +export interface BenchmarkRunResult { + schemaVersion: 1 + suiteVersion: 1 + configuration: BenchmarkRunConfiguration + environment: BenchmarkRunEnvironment + runner: Omit + startedAt: string + durationMs: number + metrics: BenchmarkMetric[] + /** Full suite size, including when this process measured just one case. */ + benchmarkCount?: number +} diff --git a/apps/benchmark/src/globals.d.ts b/apps/benchmark/src/globals.d.ts new file mode 100644 index 0000000000..904e45696f --- /dev/null +++ b/apps/benchmark/src/globals.d.ts @@ -0,0 +1,3 @@ +declare var performance: { + now(): number +} diff --git a/apps/example/src/turbo-module/ExampleTurboModule.ts b/apps/benchmark/src/turbo-module/ExampleTurboModule.ts similarity index 100% rename from apps/example/src/turbo-module/ExampleTurboModule.ts rename to apps/benchmark/src/turbo-module/ExampleTurboModule.ts diff --git a/apps/example/src/turbo-module/NativeExampleTurboModule.ts b/apps/benchmark/src/turbo-module/NativeExampleTurboModule.ts similarity index 68% rename from apps/example/src/turbo-module/NativeExampleTurboModule.ts rename to apps/benchmark/src/turbo-module/NativeExampleTurboModule.ts index a4a5bfea88..e0aaba14b3 100644 --- a/apps/example/src/turbo-module/NativeExampleTurboModule.ts +++ b/apps/benchmark/src/turbo-module/NativeExampleTurboModule.ts @@ -2,6 +2,8 @@ import { type TurboModule, TurboModuleRegistry } from 'react-native' export interface Spec extends TurboModule { addNumbers(a: number, b: number): number + /** Benchmark-only, synchronous cleanup; never called inside a timed region. */ + collectGarbage(): boolean } export default TurboModuleRegistry.getEnforcing('ExampleTurboModule') diff --git a/apps/benchmark/tsconfig.json b/apps/benchmark/tsconfig.json new file mode 100644 index 0000000000..19f59f69b1 --- /dev/null +++ b/apps/benchmark/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "@react-native/typescript-config", + "compilerOptions": { + "types": ["react"] + }, + "include": ["src", "index.js"], + "exclude": ["**/node_modules", "**/Pods"] +} diff --git a/apps/example/android/app/src/main/java/com/nitroexample/MainApplication.kt b/apps/example/android/app/src/main/java/com/nitroexample/MainApplication.kt index 5eb9af8b8e..8ab4493540 100644 --- a/apps/example/android/app/src/main/java/com/nitroexample/MainApplication.kt +++ b/apps/example/android/app/src/main/java/com/nitroexample/MainApplication.kt @@ -11,7 +11,6 @@ import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsProvider -import com.nitroexample.exampleturbomodule.ExampleTurboModulePackage private val stableFlagsWithNitroViewRecycling: ReactNativeFeatureFlagsProvider = object : ReactNativeFeatureFlagsProvider by ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android() { @@ -33,11 +32,7 @@ class MainApplication : Application(), ReactApplication { override val reactHost: ReactHost by lazy { getDefaultReactHost( context = applicationContext, - packageList = - PackageList(this).packages.apply { - // Packages that cannot be autolinked yet can be added manually here, for example: - add(ExampleTurboModulePackage()) - }, + packageList = PackageList(this).packages, ) } diff --git a/apps/example/ios/NitroExample.xcodeproj/project.pbxproj b/apps/example/ios/NitroExample.xcodeproj/project.pbxproj index acfac9976e..e36bf8eb9e 100644 --- a/apps/example/ios/NitroExample.xcodeproj/project.pbxproj +++ b/apps/example/ios/NitroExample.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; B5425A16F500085048F53261 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = A98DCE138B16911E2CF8DB85 /* PrivacyInfo.xcprivacy */; }; B81C701C2D42679D0010CA06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B81C701B2D42679D0010CA06 /* AppDelegate.swift */; }; - B88F64252CE4CF530079E862 /* MGLExampleTurboModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = B88F64242CE4CF4F0079E862 /* MGLExampleTurboModule.mm */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -37,8 +36,6 @@ 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = NitroExample/LaunchScreen.storyboard; sourceTree = ""; }; A98DCE138B16911E2CF8DB85 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = NitroExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; B81C701B2D42679D0010CA06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = NitroExample/AppDelegate.swift; sourceTree = ""; }; - B88F64232CE4CF480079E862 /* MGLExampleTurboModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLExampleTurboModule.h; sourceTree = ""; }; - B88F64242CE4CF4F0079E862 /* MGLExampleTurboModule.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLExampleTurboModule.mm; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -64,7 +61,6 @@ 13B07FAE1A68108700A75B9A /* NitroExample */ = { isa = PBXGroup; children = ( - B88F64222CE4CF3F0079E862 /* Example Turbo Module */, 13B07FB51A68108700A75B9A /* Images.xcassets */, B81C701B2D42679D0010CA06 /* AppDelegate.swift */, 13B07FB61A68108700A75B9A /* Info.plist */, @@ -114,15 +110,6 @@ name = Products; sourceTree = ""; }; - B88F64222CE4CF3F0079E862 /* Example Turbo Module */ = { - isa = PBXGroup; - children = ( - B88F64242CE4CF4F0079E862 /* MGLExampleTurboModule.mm */, - B88F64232CE4CF480079E862 /* MGLExampleTurboModule.h */, - ); - path = "Example Turbo Module"; - sourceTree = ""; - }; BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( @@ -318,7 +305,6 @@ buildActionMask = 2147483647; files = ( B81C701C2D42679D0010CA06 /* AppDelegate.swift in Sources */, - B88F64252CE4CF530079E862 /* MGLExampleTurboModule.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/apps/example/ios/Podfile.lock b/apps/example/ios/Podfile.lock index a60350b635..0b01ba2ac5 100644 --- a/apps/example/ios/Podfile.lock +++ b/apps/example/ios/Podfile.lock @@ -2253,7 +2253,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: FBLazyVector: 24e62c765683b8d89006a88a2c8f5cf019f0074d HarnessUI: bb94ae23e70e83983e4e914a8d7573969e33b930 - hermes-engine: 80dd654a47d8e827ec13a5ca97db62d3299bf012 + hermes-engine: 648069fdb45f8d7b69565640981219abe1f7f1a9 NitroModules: 8fea30a3c46ee50679d1828a71984ded6d4b83e5 NitroTest: e8f08c86d71aaf14e74a32aa50d9362c4273f062 NitroTestExternal: 716d373589a9fcb39cc05217288bdb59efe75c86 @@ -2265,7 +2265,7 @@ SPEC CHECKSUMS: React: e2dc35338068bbd299c66f043ae0d7f25de8499e React-callinvoker: 28b25d21b124c26cebaea713ba7d801b9351dc48 React-Core: 02ed7d2ffb70437bdf2aba074a13078a7b0b9ff0 - React-Core-prebuilt: 86dc7630aef2e5d063180c82b1913b576d21c6b4 + React-Core-prebuilt: 7beddea57ecfe716a246c6b3bbe754b674545163 React-CoreModules: b3a5a42dadcde3b5d47b325bd912eb2ced89e146 React-cxxreact: fe8f88dda044e5905e99a00f41b7a874c3908716 React-debug: 92944dc4d89f56d640e75498266cbde557a48189 @@ -2327,11 +2327,11 @@ SPEC CHECKSUMS: React-utils: ccc01da318979af773259c4f6cdb1876f6f86f1a React-webperformancenativemodule: f8b97c2cb6cfa94e92a503c09ad6d491c50a1390 ReactAppDependencyProvider: 25c9c516839be2c5e3d3344f95dc7da5f7e63fc2 - ReactCodegen: 0f100aa6334186385a43f0dd13d63efc6805ea55 + ReactCodegen: dfe41c3f92bdf782bcf9b2c9d7c12cb9cfd82cb7 ReactCommon: 7dfc3250793bf36cf221096ff59e1179e13eef7f - ReactNativeDependencies: d9bf93688924d6850266ddb37b789d7ba2e67482 + ReactNativeDependencies: 580160a7af9a8f556fa24c749423e7e6be1a95e1 RNScreens: 991cc417cd396602a6cf59a42139e5a9d91462a9 - Yoga: 36fee8f1fca3f54a28c3d7f80e69f66d73d3af96 + Yoga: 77dfa8673de2874e1855002ae59c68b8be9b007b PODFILE CHECKSUM: cc2ab22c5169410d8739c73db2747f1617e7eaf0 diff --git a/apps/example/package.json b/apps/example/package.json index a611fd889c..f3d8296785 100644 --- a/apps/example/package.json +++ b/apps/example/package.json @@ -54,13 +54,5 @@ }, "engines": { "node": ">=20.19.4" - }, - "codegenConfig": { - "name": "ExampleTurboModule", - "type": "modules", - "jsSrcsDir": "src", - "android": { - "javaPackageName": "com.nitroexample.exampleturbomodule" - } } } diff --git a/apps/example/src/App.tsx b/apps/example/src/App.tsx index 9bedf7fbec..91990671d9 100644 --- a/apps/example/src/App.tsx +++ b/apps/example/src/App.tsx @@ -5,12 +5,10 @@ import { NavigationContainer } from '@react-navigation/native' import { createBottomTabNavigator } from '@react-navigation/bottom-tabs' import { useColors } from './useColors' import { Image } from 'react-native' -import { BenchmarksScreen } from './screens/BenchmarksScreen' import { ViewScreen } from './screens/ViewScreen' import { EvalScreen } from './screens/EvalScreen' const dna = require('./img/dna.png') -const rocket = require('./img/rocket.png') const map = require('./img/map.png') const terminal = require('./img/terminal.webp') @@ -41,20 +39,6 @@ export default function App() { ), }} /> - ( - - ), - }} - /> void + +declare var performance: { + now(): number +} diff --git a/apps/example/src/screens/BenchmarksScreen.tsx b/apps/example/src/screens/BenchmarksScreen.tsx deleted file mode 100644 index c4d9ac7150..0000000000 --- a/apps/example/src/screens/BenchmarksScreen.tsx +++ /dev/null @@ -1,305 +0,0 @@ -/* eslint-disable react-native/no-inline-styles */ - -import * as React from 'react' - -import { - StyleSheet, - View, - Text, - Button, - Platform, - Animated, - useWindowDimensions, -} from 'react-native' -import { NitroModules } from 'react-native-nitro-modules' -import { useSafeAreaInsets } from 'react-native-safe-area-context' -import { useColors } from '../useColors' -import { HybridTestObjectSwiftKotlin } from 'react-native-nitro-test' -import { ExampleTurboModule } from '../turbo-module/ExampleTurboModule' - -declare global { - var gc: () => void - var performance: { - now: () => number - } -} - -interface BenchmarksResult { - numberOfIterations: number - nitroExecutionTimeMs: number - turboExecutionTimeMs: number -} - -function delay(ms: number): Promise { - return new Promise((resolve) => setTimeout(resolve, ms)) -} - -async function waitForGc(): Promise { - gc() - await delay(500) -} - -interface BenchmarkableObject { - addNumbers(a: number, b: number): number -} -function benchmark(obj: BenchmarkableObject): number { - // warmup - obj.addNumbers(0, 3) - - // run addNumbers(...) ITERATIONS amount of times - const start = performance.now() - let num = 0 - for (let i = 0; i < ITERATIONS; i++) { - num = obj.addNumbers(num, 3) - } - const end = performance.now() - return end - start -} - -const ITERATIONS = 100_000 -async function runBenchmarks(): Promise { - console.log(`Running benchmarks ${ITERATIONS}x...`) - await waitForGc() - - const turboTime = benchmark(ExampleTurboModule) - const nitroTime = benchmark(HybridTestObjectSwiftKotlin) - - console.log( - `Benchmarks finished! Nitro: ${nitroTime.toFixed(2)}ms | Turbo: ${turboTime.toFixed(2)}ms` - ) - return { - nitroExecutionTimeMs: nitroTime, - turboExecutionTimeMs: turboTime, - numberOfIterations: ITERATIONS, - } -} - -export function BenchmarksScreen() { - const safeArea = useSafeAreaInsets() - const colors = useColors() - const dimensions = useWindowDimensions() - const [status, setStatus] = React.useState('📱 Idle') - const [results, setResults] = React.useState() - const nitroWidth = React.useRef(new Animated.Value(0)).current - const turboWidth = React.useRef(new Animated.Value(0)).current - - const factor = React.useMemo(() => { - if (results == null) return 0 - const f = results.turboExecutionTimeMs / results.nitroExecutionTimeMs - return Math.round(f * 10) / 10 - }, [results]) - - const run = async () => { - nitroWidth.setValue(0) - turboWidth.setValue(0) - setStatus(`⏳ Running Benchmarks`) - const r = await runBenchmarks() - setResults(r) - - const slowest = Math.max(r.nitroExecutionTimeMs, r.turboExecutionTimeMs) - const maxWidth = dimensions.width * 0.65 - Animated.spring(turboWidth, { - toValue: (r.turboExecutionTimeMs / slowest) * maxWidth, - friction: 10, - tension: 40, - useNativeDriver: false, - }).start() - Animated.spring(nitroWidth, { - toValue: (r.nitroExecutionTimeMs / slowest) * maxWidth, - friction: 10, - tension: 40, - useNativeDriver: false, - }).start() - setStatus(`📱 Idle`) - } - - return ( - - Benchmarks - - - {NitroModules.buildType} - - - - {results != null ? ( - - - Calling addNumbers(...){' '} - {ITERATIONS}x: - - - - - Turbo Modules - - - - - Time:{' '} - - {results.turboExecutionTimeMs.toFixed(2)}ms - - - - - - - - Nitro Modules - - - - - Time:{' '} - - {results.nitroExecutionTimeMs.toFixed(2)}ms - - {' '}({factor}x{' '} - {factor > 1 ? 'faster' : 'slower'}!) - - - - ) : ( - - Press Run to call{' '} - addNumbers(...) {ITERATIONS} times. - - )} - - - - - {status} - - -