Geospatial Benchmarks
March 23, 2026 · View on GitHub
Batch geodesic distance benchmarks comparing NumKong against the geo and geopy libraries for Haversine and Vincenty formulas.
Rust
| Library | Precision | MP/s |
|---|---|---|
| Haversine | ||
numkong::haversine | f32 → f32 | 491.98 |
numkong::haversine | f64 → f64 | 149.72 |
| serial baseline | f32 → f32 | 137.83 |
geo::Haversine distance | f32 → f32 | 136.96 |
| serial baseline | f64 → f64 | 94.33 |
geo::Haversine distance | f64 → f64 | 92.48 |
| Vincenty | ||
numkong::vincenty | f32 → f32 | 71.64 |
| serial baseline | f32 → f32 | 18.20 |
numkong::vincenty | f64 → f64 | 13.73 |
| serial baseline | f64 → f64 | 6.47 |
geo::Vincenty distance | f64 → f64 | 2.76 |
Python
| Library | Precision | MP/s |
|---|---|---|
numkong.haversine | f32 → f32 | 444.38 |
numkong.haversine | f64 → f64 | 132.85 |
numkong.vincenty | f32 → f32 | 65.89 |
numkong.vincenty | f64 → f64 | 11.93 |
geopy.distance.great_circle | f64 → f64 | 0.47 |
geopy.distance.geodesic | f64 → f64 | 0.03 |
Run It
Rust
# Default 2048 coordinate pairs
cargo bench --bench bench_geospatial --features bench_geospatial
# Smaller 256 coordinate pairs
NUMWARS_DIMS=256 \
cargo bench --bench bench_geospatial --features bench_geospatial
# Focus on one metric
NUMWARS_FILTER="geospatial/haversine/f32" \
cargo bench --bench bench_geospatial --features bench_geospatial
Python
# Run the Python suite
uv run --with numkong,numpy,geopy,tabulate python geospatial/bench.py --count 2048