Benchmark

This app benchmarks cached location read overhead between react-native-nitro-geolocation and @react-native-community/geolocation.

react-native-nitro-geolocation

📊 Benchmark Results

Test Environment:

  • Device: iPhone 14 Pro
  • React Native: 0.81.4
  • Test: 1000 iterations × 5 runs of getCurrentPosition with cached location (measuring pure bridge/JSI latency)
Benchmark scope

This benchmark measures cached location reads and the JS-to-native call path. It does not measure cold GPS acquisition, permission dialogs, provider availability, or OS throttling. Nitro does not make GPS acquisition itself 22x faster; it makes cached reads and the JS-to-native path cheaper.

Results

MetricNitroCommunityImprovement
Average0.019ms0.436ms22.95x faster
Median0.017ms0.045ms62.2% faster
Min0.014ms0.034ms58.8% faster
Max1.007ms10.577ms90.5% faster
P950.025ms6.434ms257.4x faster
P990.031ms7.271ms234.5x faster
Std Dev0.032ms1.545ms98.0% more stable
Samples10001000-

Why is Nitro faster for cached reads?

  1. Zero Queue Overhead: Cached location responses return immediately without any dispatch queue overhead
  2. Direct JSI Calls: No JSON serialization or async bridge crossing
  3. Optimized Architecture: Fast path for cached responses, queue-free delegate callbacks