feat(perf): performance lab with baselines and bottleneck scorecard - #73
feat(perf): performance lab with baselines and bottleneck scorecard#73jkasprzyk17 wants to merge 6 commits into
Conversation
…defs CocoaPods evaluates a podspec with eval, and on Ruby 4.0.6 + CocoaPods 1.17.0 a method defined that way is not visible inside the Pod::Spec.new block, so pod install fails with "undefined method 'better_maps_ios_google_provider_enabled?' for module Pod". Hold the helpers in local lambdas instead; behavior is unchanged.
Release builds failed with "Type com.facebook.fbreact.specs.NativeAccessibilityInfoSpec is defined multiple times". The library applies com.facebook.react, whose codegen root defaults to the package directory; with an isolated installer (bun, pnpm) that directory contains node_modules/react-native, so the plugin generated React Native's own core specs into this library and they collided with react-android when the release dex was merged. Debug builds hide it because project and library dex files are merged separately. Point jsRootDir at src, which holds no React Native codegen specs; nitrogen generates this library's bindings.
…peline Timing probes around marker set/fingerprint/index/viewport/cluster/diff/apply, shape setters, camera and region application, MapKit annotation views and Google marker visuals. They compile in only with -DNITROMAPS_PERF_PROBES (betterMaps.perfProbes in Podfile.properties.json) on iOS and -PNitroMaps_perfProbes=true (BuildConfig.PERF_PROBES) on Android; otherwise every call site is an inlined no-op or a folded constant check. Profile builds also emit os_signpost intervals and android.os.Trace sections. A small Objective-C/reflection bridge lets the performance lab drain the spans. Adds opt-in JVM and XCTest micro-benchmarks for the pipeline's pure functions and guards the Google-only iOS test with canImport(GoogleMaps).
A reproducible profiling and benchmarking environment under performance/: seeded fixtures with pinned hashes, 97 scenarios across markers, camera, mutations, geometry, clustering, combined and stability workloads, an in-app runner that records display-link/Choreographer frame intervals, JS-thread lag (animation frames on iOS, a native JS message-queue ping on Android), React commit timing, commit-to-native latency, native probe spans, memory, Hermes and ART allocation counters, CPU and thermal state, and the JS-to-native transfer profile per scenario. A bun perf CLI builds the lab variant of the example app, drives runs over a deep link, harvests results from the device log and result files, stores baselines, compares runs and applies regression thresholds. The lab UI ships only with EXPO_PUBLIC_PERF_LAB=1 and lives in the example app plus a local Expo module; nothing in the published package changes.
…k scorecard Baselines for the iPhone 17 Pro simulator (MapKit) and the Android API 35 arm64 emulator (Google Maps), both release builds with probes, plus JVM pipeline and bun micro-benchmark output. PERFORMANCE.md holds the generated scorecard, the top ten measured bottlenecks with evidence, the optimization backlog and the first optimization to attempt. No optimization is applied. Simulator and emulator numbers are marked not production-representative; the physical-device baseline is still pending.
|
Important Review skippedToo many files! This PR contains 194 files, which is 44 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to Team to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (194)
You can disable this status message by setting the Comment |
|
React Doctor found 6 issues in 3 files · 2 errors & 4 warnings · score 64 / 100 (Needs work) · full project Errors
4 warnings
Reviewed by React Doctor for commit |
The root .gitignore ignores every lib/ directory (library build output), which silently dropped performance/scripts/lib and performance/benchmarks/lib from the previous commit; the CLI and the micro-benchmarks import from them.
Summary
A production-grade performance lab for
react-native-better-maps, plus the first baselines and a measured bottleneck report. No optimization is applied; the library changes are compile-time timing probes (no-ops unless a build opts in) and the two build fixes this machine needed (podspec lambdas, Android codegen root).performance/— seeded fixtures (pinned hashes), 97 scenarios (markers 100…100k, camera × marker count, marker mutation benchmark, polylines/polygons 100…100k points, clustering 1k…100k, combined workloads, 5/15-minute stability), an in-app runner and abun perfCLI (list,run,baseline,compare,check,report,scorecard,bench,fixtures,build,install).example/modules/perf-lab— local Expo module:CADisplayLink/Choreographerframe intervals (+ AndroidFrameMetrics), memory (phys_footprint/PSS, Java/native heap, ART GC counters, malloc blocks), CPU, thermal/battery, a native ping of the JS message queue (Android), probe drain, result files and log lines.PerfProbe.swift/PerfProbe.kt— spans around marker set/fingerprint/index/viewport/cluster/diff/apply, shape setters, camera/region, annotation views. Compiled in only withbetterMaps.perfProbes(Podfile.properties) /-PNitroMaps_perfProbes=true; release builds carry nothing.performance/PERFORMANCE.md— generated scorecard for both baselines, top 10 bottlenecks with evidence, ranked backlog, and the recommended first optimization.Baselines recorded
Headline findings (details and numbers in PERFORMANCE.md)
Recommended first optimization: an id-keyed delta update path next to the bulk
markersprop (P0); themutations-10kscenario measures it directly.How to run
Validation
bun run lint,bun run typecheck,bun run typecheck:provider-types,bun run build, package tests (32) and lab tests (22,bun run perf:test) pass.main, so it measures the unoptimized library; the scenarios in feat(example): add a frame-time benchmark harness #66 map ontomarkers-*,camera-*,cluster-*,polyline-*/polygon-*here.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.