Skip to content

add mobench support to ProveKit v1#451

Open
dcbuild3r wants to merge 2 commits into
v1from
dcbuilder/pr430-mobench-v1-browserstack
Open

add mobench support to ProveKit v1#451
dcbuild3r wants to merge 2 commits into
v1from
dcbuilder/pr430-mobench-v1-browserstack

Conversation

@dcbuild3r
Copy link
Copy Markdown
Collaborator

Reopened from #430 using the new dcbuilder/* branch naming.

Old PR: #430
Replacement branch: dcbuilder/pr430-mobench-v1-browserstack
Old head branch: dcbuild3r/mobench-v1-browserstack
Head SHA: 94786155017ac2b11505a012ddb181f9e8a1a1c6

Previous PR CI / benchmark runs from #430:

Summary

  • add v1 mobench BrowserStack wiring for passport age-check and OPRF prove benchmarks
  • run the same full Android/iOS triad matrix as PR add mobench support to ProveKit main #429
  • fix Android prove timing so fixture clone/setup is outside the measured prove span
  • use jemalloc as the Android fallback allocator under the native C FFI allocator
  • harden Android incomplete-fixture reporting with timeout/build/kill-evidence fields

Android mobench fix note

The earlier failing run was https://github.com/worldfnd/provekit/actions/runs/26002840796. The missing Vivo Y21 monolithic cell did not recover a BrowserStack session payload or summary.json; available artifacts only show the BrowserStack fetch timeout after 7200s for build b1ebace919a1b8cad3861313180ac9a18a7e461d.

Before/failure memory from that run:

  • Vivo Y21 OPRF: 291 MB process peak, 9.614s
  • Vivo Y21 fragmented age check: 1206 MB process peak, 44.896s
  • Vivo Y21 monolithic age check: no row; BrowserStack timeout/no summary
  • S24 OPRF: 365 MB process peak, 2.216s

What changed:

  • Android and iOS now use the same semantic boundary for prove benches: per-iteration fixture setup happens before the measured closure, and profile_phase("prove") wraps only the prover entry point. Previously prepared.clone() ran inside profile_phase("prove"), so clone cost and peak memory were charged to proving.
  • Android native C FFI fallback allocation now routes through jemalloc instead of Bionic malloc when no host callback/mmap allocator is active.
  • If BrowserStack returns no summary, failure.json now records attempts, fetch timeout seconds, build id, and any LMK/OOM/SIGKILL lines recovered from attempt/device logs.

Latest benchmark numbers were reposted as a PR comment from #430.

Validation

  • cargo fmt --all
  • cargo test -p bench-mobile --lib
  • cargo test -p bench-mobile --test examples_smoke
  • cargo test -p bench-mobile --test passport_smoke
  • cargo check -p provekit-ffi --target aarch64-linux-android with NDK 26.1 aarch64-linux-android34-clang
  • ruby -e 'require "yaml"; YAML.load_file(".github/workflows/mobile-bench-reusable.yml")'
  • git diff --check

Copy link
Copy Markdown
Collaborator Author

Latest mobile benchmark numbers

Reposted from #430 comment #430 (comment).

Source: Mobile Bench PR Auto run 26368378198 on dcbuild3r/mobench-v1-browserstack at 94786155.
Mobench version: 0.1.42. Artifact summaries report 2 measured runs per function/device plus 1 warmup run.

iOS

Benchmark Device Runs Warmup Mean/run Median p95 Min Max Wall total CPU median/run CPU total CPU/wall Peak growth Peak memory Process peak
OPRF iPhone 16 Pro Max 2 1 510.137ms 510.137ms 513.350ms 506.923ms 513.350ms 1.020s 1.214s 2.429s 238.1% 12.20 MB 12.20 MB 355.25 MB
OPRF iPhone 14 2 1 1.323s 1.323s 1.334s 1.312s 1.334s 2.646s 2.176s 4.353s 164.5% 10.86 MB 10.86 MB 147.92 MB
OPRF iPhone SE 2022 2 1 956.647ms 956.647ms 1.053s 860.161ms 1.053s 1.913s 1.784s 3.569s 186.5% 11.02 MB 11.02 MB 148.77 MB
Passport fragmented iPhone 16 Pro Max 2 1 3.085s 3.085s 3.124s 3.046s 3.124s 6.170s 12.666s 25.333s 410.6% 186.78 MB 186.78 MB 1014.66 MB
Passport fragmented iPhone 14 2 1 4.215s 4.215s 4.243s 4.187s 4.243s 8.429s 16.325s 32.650s 387.3% 247.11 MB 247.11 MB 730.53 MB
Passport fragmented iPhone SE 2022 2 1 4.345s 4.345s 4.389s 4.302s 4.389s 8.691s 16.986s 33.973s 390.9% 247.08 MB 247.08 MB 731.81 MB
Passport complete iPhone 16 Pro Max 2 1 3.344s 3.344s 3.368s 3.320s 3.368s 6.688s 14.587s 29.174s 436.2% 359.48 MB 359.48 MB 1485.80 MB
Passport complete iPhone 14 2 1 4.843s 4.843s 5.060s 4.625s 5.060s 9.685s 20.282s 40.565s 418.8% 489.75 MB 489.75 MB 1062.66 MB
Passport complete iPhone SE 2022 2 1 4.842s 4.842s 5.069s 4.615s 5.069s 9.684s 20.403s 40.807s 421.4% 487.70 MB 487.70 MB 1057.06 MB

Android

Benchmark Device Runs Warmup Mean/run Median p95 Min Max Wall total CPU median/run CPU total CPU/wall Peak growth Peak memory Process peak
OPRF Samsung Galaxy S24 2 1 2.096s 2.096s 2.104s 2.088s 2.104s 4.192s 5.343s 10.687s 254.9% 39.83 MB 39.83 MB 430.64 MB
OPRF Google Pixel 7 2 1 5.686s 5.686s 5.915s 5.457s 5.915s 11.372s 7.901s 15.802s 139.0% 2.85 MB 2.85 MB 201.77 MB
OPRF Samsung Galaxy M32 2 1 6.116s 6.116s 6.717s 5.515s 6.717s 12.232s 10.126s 20.252s 165.6% 1.80 MB 1.80 MB 286.83 MB
Passport fragmented Samsung Galaxy S24 2 1 13.130s 13.130s 13.281s 12.978s 13.281s 26.260s 41.271s 82.543s 314.3% 263.05 MB 263.05 MB 984.10 MB
Passport fragmented Google Pixel 7 2 1 17.882s 17.882s 17.919s 17.845s 17.919s 35.764s 45.644s 91.289s 255.3% 192.33 MB 192.33 MB 716.82 MB
Passport fragmented Samsung Galaxy M32 2 1 30.928s 30.928s 30.973s 30.884s 30.973s 61.857s 85.175s 170.350s 275.4% 308.50 MB 308.50 MB 854.13 MB
Passport complete Samsung Galaxy S24 2 1 9.409s 9.409s 9.424s 9.395s 9.424s 18.819s 34.250s 68.501s 364.0% 442.15 MB 442.15 MB 1205.77 MB
Passport complete Google Pixel 7 2 1 16.684s 16.684s 16.891s 16.477s 16.891s 33.368s 47.877s 95.755s 287.0% 378.04 MB 378.04 MB 956.37 MB
Passport complete Samsung Galaxy M32 2 1 28.874s 28.874s 29.144s 28.604s 29.144s 57.748s 89.707s 179.414s 310.7% 586.32 MB 586.32 MB 1335.73 MB

Memory growth is the benchmark-reported peak growth above baseline; process peak is the reported process RSS peak.

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