Skip to content

ci: reuse the Gradle daemon for benchmark builds - #1628

Open
mrousavy wants to merge 4 commits into
mainfrom
ci/reuse-benchmark-gradle-daemon
Open

ci: reuse the Gradle daemon for benchmark builds#1628
mrousavy wants to merge 4 commits into
mainfrom
ci/reuse-benchmark-gradle-daemon

Conversation

@mrousavy

@mrousavy mrousavy commented Sep 7, 2026

Copy link
Copy Markdown
Member

The paired Android benchmark build currently starts and stops a single-use Gradle daemon for each revision. Remove --no-daemon so compatible head and base builds in the same job can reuse the daemon. The existing Gradle build cache stays enabled; device measurements run in a separate job.

All checks passed on 41bfd38dd663f12f33ef625e6bc10a9867cc6fcd, including both native builds and both measurement jobs in run 34154006746. Bash syntax, ShellCheck, artifact selection and app-isolation tests also passed.

Build timing review:

Configuration Head Gradle build Base Gradle build Build/package APK step
Daemon reuse, current head 71 s 61 s 144 s
Unchanged Android build, #1629 63 s 62 s 135 s
Unchanged Android build, #1630 67 s 64 s 143 s
Daemon reuse, before rebase 67 s 55 s 133 s

The current head and two controls share the same main base, runner class and restored Gradle cache. Their task counts match: head executes 140 tasks with 64 cached; base executes 135 with 69 cached. Both daemon runs start one reusable JVM, while the controls start two single-use daemons. The earlier run's Android build passed before the workflow was cancelled by the rebase.

The second build benefits from reuse, but a reduction in total build time is not demonstrated by these separate hosted runs. Their build/package timings overlap. Keep the PR open pending stronger timing evidence; current results do not justify claiming an overall speedup.

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
nitro-docs Ready Ready Preview Sep 9, 2026 12:31pm UTC

Request Review

@nitro-modules-bot

This comment has been minimized.

@mrousavy
mrousavy marked this pull request as ready for review September 7, 2026 19:20
@mrousavy

mrousavy commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

@nitro-modules-bot please test performance

@nitro-modules-bot

This comment has been minimized.

@mrousavy

mrousavy commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@nitro-modules-bot please test performance

@nitro-modules-bot

This comment has been minimized.

@mrousavy

mrousavy commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@nitro-modules-bot please test performance

@nitro-modules-bot

This comment has been minimized.

@mrousavy

mrousavy commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

https://github.com/nitro-modules-bot please test performance

@mrousavy

mrousavy commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@nitro-modules-bot please test performance

@nitro-modules-bot

This comment has been minimized.

@mrousavy

mrousavy commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@nitro-modules-bot please test performance

@nitro-modules-bot

Copy link
Copy Markdown

Performance Report

iOS

Benchmark Before After Difference
C++ immediatePromise() 775.6 ns 819.1 ns 🔴 +5.61% slower
All Benchmarks
Benchmark Before After Difference
JavaScript addNumbers() 23.3 ns 24.3 ns 🔴 +4.16% slower
C++ bounce(1 MiB) 234.6 ns 234.9 ns 🔴 +0.14% slower
C++ bounce(4 KiB) 228.6 ns 233.1 ns 🔴 +1.98% slower
C++ bounce native-owned buffer (1 MiB) 3.67 µs 3.62 µs 🟢 -1.49% faster
C++ bounce native-owned buffer (4 KiB) 351.5 ns 354.3 ns 🔴 +0.8% slower
C++ copy(1 MiB) 63.51 µs 65.15 µs 🔴 +2.58% slower
C++ copy(4 KiB) 960.2 ns 964.7 ns 🔴 +0.46% slower
C++ large array (1,024) 48.90 µs 48.95 µs 🔴 +0.1% slower
C++ small array (16) 913.7 ns 911.7 ns 🟢 -0.22% faster
C++ synchronousCallback() 198.6 ns 196.7 ns 🟢 -0.97% faster
C++ create() 421.8 ns 428.0 ns 🔴 +1.46% slower
C++ returnExisting() 192.0 ns 191.9 ns 🟢 -0.04% faster
C++ typed map (8 entries) 1.87 µs 1.83 µs 🟢 -1.71% faster
C++ optional trailing string 142.1 ns 144.1 ns 🔴 +1.4% slower
C++ addNumbers() 82.3 ns 82.3 ns 🔴 +0.01% slower
C++ simpleFunc() 65.4 ns 64.6 ns 🟢 -1.12% faster
C++ deferred worker Promise (includes trigger call) 21.86 µs 21.13 µs 🟢 -3.36% faster
C++ number property get/set 130.4 ns 129.3 ns 🟢 -0.85% faster
C++ short ASCII string 138.3 ns 137.4 ns 🟢 -0.61% faster
C++ Unicode string 276.6 ns 272.4 ns 🟢 -1.54% faster
C++ nested Car struct 2.41 µs 2.38 µs 🟢 -1.14% faster
C++ number | string variant 125.8 ns 124.1 ns 🟢 -1.37% faster
Swift bounce(1 MiB) 220.9 ns 210.4 ns 🟢 -4.78% faster
Swift bounce(4 KiB) 225.3 ns 230.0 ns 🔴 +2.05% slower
Swift bounce native-owned buffer (1 MiB) 3.29 µs 3.31 µs 🔴 +0.44% slower
Swift bounce native-owned buffer (4 KiB) 342.8 ns 342.7 ns 🟢 -0.03% faster
Swift copy(1 MiB) 63.17 µs 60.90 µs 🟢 -3.58% faster
Swift copy(4 KiB) 904.6 ns 892.7 ns 🟢 -1.32% faster
Swift large array (1,024) 45.01 µs 45.61 µs 🔴 +1.35% slower
Swift small array (16) 933.4 ns 958.7 ns 🔴 +2.71% slower
Swift synchronousCallback() 232.9 ns 226.4 ns 🟢 -2.79% faster
Swift create() 24.99 µs 23.88 µs 🟢 -4.45% faster
Swift returnExisting() 237.5 ns 236.8 ns 🟢 -0.28% faster
Swift typed map (8 entries) 2.39 µs 2.39 µs 🔴 +0.3% slower
Swift optional trailing string 154.8 ns 149.1 ns 🟢 -3.7% faster
Swift addNumbers() 68.3 ns 69.3 ns 🔴 +1.55% slower
Swift simpleFunc() 57.7 ns 58.0 ns 🔴 +0.6% slower
Swift deferred worker Promise (includes trigger call) 23.92 µs 24.15 µs 🔴 +0.97% slower
Swift immediatePromise() 1.28 µs 1.24 µs 🟢 -3.4% faster
Swift number property get/set 128.5 ns 125.1 ns 🟢 -2.62% faster
Swift short ASCII string 157.5 ns 157.8 ns 🔴 +0.18% slower
Swift Unicode string 330.9 ns 324.4 ns 🟢 -1.96% faster
Swift nested Car struct 2.26 µs 2.26 µs 🟢 -0.15% faster
Swift number | string variant 188.0 ns 191.9 ns 🔴 +2.11% slower
TurboModule addNumbers() 905.0 ns 907.2 ns 🔴 +0.25% slower

Android

Benchmark Before After Difference
C++ create() 612.4 ns 559.7 ns 🟢 -8.6% faster
C++ typed map (8 entries) 1.61 µs 1.71 µs 🔴 +5.63% slower
Kotlin deferred worker Promise (includes trigger call) 32.05 µs 34.96 µs 🔴 +9.1% slower
All Benchmarks
Benchmark Before After Difference
JavaScript addNumbers() 21.2 ns 21.1 ns 🟢 -0.35% faster
C++ bounce(1 MiB) 411.1 ns 404.9 ns 🟢 -1.51% faster
C++ bounce(4 KiB) 400.0 ns 397.4 ns 🟢 -0.67% faster
C++ bounce native-owned buffer (1 MiB) 3.17 µs 3.18 µs 🔴 +0.31% slower
C++ bounce native-owned buffer (4 KiB) 413.5 ns 407.1 ns 🟢 -1.54% faster
C++ copy(1 MiB) 26.57 µs 26.68 µs 🔴 +0.42% slower
C++ copy(4 KiB) 775.8 ns 808.4 ns 🔴 +4.2% slower
C++ large array (1,024) 38.10 µs 38.35 µs 🔴 +0.65% slower
C++ small array (16) 775.9 ns 771.8 ns 🟢 -0.53% faster
C++ synchronousCallback() 312.7 ns 310.9 ns 🟢 -0.56% faster
C++ returnExisting() 214.3 ns 212.4 ns 🟢 -0.89% faster
C++ optional trailing string 137.8 ns 134.4 ns 🟢 -2.44% faster
C++ addNumbers() 88.7 ns 86.0 ns 🟢 -3.09% faster
C++ simpleFunc() 69.9 ns 70.1 ns 🔴 +0.24% slower
C++ deferred worker Promise (includes trigger call) 22.30 µs 22.13 µs 🟢 -0.74% faster
C++ immediatePromise() 844.0 ns 859.1 ns 🔴 +1.79% slower
C++ number property get/set 151.2 ns 151.2 ns 🔴 +0.03% slower
C++ short ASCII string 126.3 ns 126.1 ns 🟢 -0.16% faster
C++ Unicode string 230.4 ns 229.2 ns 🟢 -0.52% faster
C++ nested Car struct 2.05 µs 2.06 µs 🔴 +0.54% slower
C++ number | string variant 124.6 ns 123.6 ns 🟢 -0.8% faster
Kotlin bounce(1 MiB) 1.01 µs 967.9 ns 🟢 -3.84% faster
Kotlin bounce(4 KiB) 935.9 ns 936.6 ns 🔴 +0.08% slower
Kotlin bounce native-owned buffer (1 MiB) 3.83 µs 3.91 µs 🔴 +2.11% slower
Kotlin bounce native-owned buffer (4 KiB) 1.10 µs 1.10 µs 🔴 +0.17% slower
Kotlin copy(1 MiB) 263.64 µs 272.33 µs 🔴 +3.3% slower
Kotlin copy(4 KiB) 4.49 µs 4.45 µs 🟢 -0.83% faster
Kotlin large array (1,024) 40.71 µs 39.77 µs 🟢 -2.3% faster
Kotlin small array (16) 1.00 µs 1.01 µs 🔴 +0.84% slower
Kotlin synchronousCallback() 991.4 ns 953.6 ns 🟢 -3.81% faster
Kotlin create() 1.50 µs 1.52 µs 🔴 +1.18% slower
Kotlin returnExisting() 549.1 ns 536.4 ns 🟢 -2.31% faster
Kotlin typed map (8 entries) 5.91 µs 5.89 µs 🟢 -0.23% faster
Kotlin optional trailing string 303.0 ns 307.7 ns 🔴 +1.56% slower
Kotlin addNumbers() 117.9 ns 118.4 ns 🔴 +0.46% slower
Kotlin simpleFunc() 91.9 ns 92.0 ns 🔴 +0.09% slower
Kotlin immediatePromise() 2.11 µs 2.10 µs 🟢 -0.7% faster
Kotlin number property get/set 217.3 ns 222.6 ns 🔴 +2.48% slower
Kotlin short ASCII string 402.6 ns 406.7 ns 🔴 +1.03% slower
Kotlin Unicode string 694.5 ns 690.7 ns 🟢 -0.55% faster
Kotlin nested Car struct 4.26 µs 4.22 µs 🟢 -1.14% faster
Kotlin number | string variant 388.2 ns 385.8 ns 🟢 -0.62% faster
TurboModule addNumbers() 213.8 ns 215.0 ns 🔴 +0.6% slower

Benchmarking Code Diff 201794bf...9351d8d9 (view raw output)

Raw measurements and artifacts

Raw measurements: performance-report-1 (JSON artifact). Run 34351445968, attempt 1. Download requires GitHub access.

Android: measurements, attempt 1, apps, attempt 1.
iOS: measurements, attempt 1, apps, attempt 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant