Skip to content

Benchmarks

Compare call times for planar geometry, great-circle geometry, coordinate transforms, grids, and spatial-index queries. Each workload pairs gometry with a reference implementation or a Python library such as Shapely, Spherely, GeoPandas, or pyproj. The tables name the comparator and the inputs for each operation.

On this run (86 workloads): gometry faster: 82; slower: 2; similar: 0; inconclusive: 2.

API comparisons

Array construction & I/O

API / inputgometryComparator
from_wkb mixed EWKB 10k mixed EWKB gometry 1.52 ms 1.61× faster2.45 ms Shapely
from_arrow mixed GeoArrow WKB 100k mixed GeoArrow WKB / 10% missing gometry 12.60 ms 1.96× faster24.38 ms GeoPandas
to_wkb mixed EWKB 10k mixed EWKB gometry 712.03 us 4.22× faster3.01 ms Shapely
coords matrix and row_index 100k vertices / float64 matrix + int64 row index gometry 117.63 us 3.54× faster415.16 us Shapely
points from NumPy XY 10k NumPy XY gometry 5.14 us 211.49× faster1.08 ms Shapely
from WKT mixed geometries 10k realistic mixed WKT gometry 4.14 ms 3.19× faster13.14 ms Shapely
from GeoJSON countries 217 countries / 2.26 MB / ordered geometry, properties and ID rows gometry 14.12 ms 2.04× faster28.80 ms Shapely + Python json
Read exact viewport from GeoParquet 16k projected parcel records / covering filter, exact hits and IDs gometry 3.93 ms 7.09× faster27.93 ms GeoPandas
Columnar import, gather, transform and export 100k mixed nullable WKB rows / reversed duplicate gather / projected areas gometry 12.70 ms 1.79× faster22.63 ms GeoPandas + Shapely

Geometry

API / inputgometryComparator
intersects irregular polygon points 12k interior, boundary, and exterior probes gometry 1.40 ms 1.99× faster2.78 ms Shapely
prepared polygon contains coordinate probes 100k probes / 1,316-coordinate holed polygon gometry 3.96 ms 2.01× faster7.98 ms Shapely
dwithin pairwise 10k pairs / 50% matches gometry 4.55 us 44.85× faster203.53 us Shapely
area projected buildings 10k projected buildings gometry 153.32 us 1.13× faster173.42 us Shapely
length roads 10k roads / 100k vertices gometry 135.45 us 1.45× faster195.48 us Shapely
simplify Douglas-Peucker 10k roads / 100k vertices gometry 779.04 us 5.20× faster4.05 ms Shapely
buffer projected points 10k projected points gometry 2.12 ms 22.01× faster46.85 ms Shapely
intersection pairwise 1k irregular polygon pairs gometry 4.56 ms 1.48× faster6.77 ms Shapely
intersects pairwise polygons 1k irregular polygon pairs gometry 391.02 us 1.43× faster559.20 us Shapely
coverage_union_all parcels 10k edge-matched parcels gometry 1.94 ms 2.68× faster5.20 ms Shapely
Fixed-precision district dissolve 512 overlapping parcel footprints in 32 districts / 1 m grid gometry 10.33 ms Inconclusive10.28 ms GeoPandas
is_valid mixed polygons 10k mixed polygons / 20% invalid gometry 4.88 ms 1.88× faster9.11 ms Shapely
repair linework 1k invalid polygons gometry 10.14 ms 8.77× faster90.88 ms Shapely
bounds projected buildings 10k projected buildings gometry 63.40 us 2.57× faster163.34 us Shapely
Intersect short lines with a rectangle 10,000 three-vertex lines; 40% crossing, 40% inside, 20% outside gometry 27.61 ms 1.61× faster44.36 ms Shapely
point_on_surface buildings 10k concave and holed buildings gometry 1.03 ms 2.07× faster2.13 ms Shapely
Spherical real-boundary load and query WKB admission, preparation and 10k country-derived POIs gometry 4.00 ms 1.50× slower2.67 ms Spherely
Spherical load and query WKB polygon admission, preparation and 12k point queries gometry 1.23 ms 5.84× faster7.27 ms Spherely
Spherical intersection and serialization 4 distinct aligned and oblique great-circle polygon pairs / WKB output gometry 166.19 us 3.02× slower55.33 us Spherely

CRS & geodesy

API / inputgometryComparator
to_space masked points 200k points / 10% missing ‡gometry 10.82 ms 6.80× faster74.48 ms GeoPandas
Transform stored road vertices 10k UTM roads / 100k vertices / vertex-only EPSG:4326 conversion ‡gometry 10.65 ms 1.69× faster18.03 ms GeoPandas
crs_transform WGS84 to Web Mercator 10k EPSG:4326 to 3857 gometry 315.92 us 2.43× faster767.57 us pyproj
geodesic distance 10k WGS84 pairs †gometry 7.50 ms 1.06× faster7.96 ms pyproj
geodesic destination 10k WGS84 destinations †gometry 3.28 ms 1.28× faster4.20 ms pyproj + Shapely + GeoPandas
Spherical area of Brazil OSM Brazil / explicit 6371000 metre sphere / great-circle edges gometry 20.37 us 1.44× faster29.21 us Spherely

Discrete global grids

API / inputgometryComparator
geohash encode tokens 10k WGS84 points / precision 6 gometry 600.94 us 7.43× faster4.48 ms pygeohash
h3 cover center Brazil Brazil res5 / 32,260 cells gometry 24.31 ms 1.25× faster30.42 ms h3-py
h3_compact 32,260 to 1,732 cells gometry 136.20 us 3.97× faster544.71 us h3-py

Spatial index

API / inputgometryComparator
one-shot join within 10k POIs x 217 countries gometry 4.35 ms 6.69× faster29.31 ms Shapely
index join within 10k POIs x 217 countries gometry 3.53 ms 8.40× faster29.68 ms Shapely
index candidates 1k queries x 10k polygons gometry 988.44 us 4.66× faster4.64 ms Shapely
index nearest k=1 1k non-intersecting queries x 10k polygons gometry 2.43 ms 2.09× faster5.07 ms Shapely
exact rectangle query: packed points 256 viewports / 10k projected points / varied hit counts gometry 225.80 us 7.02× faster1.58 ms Shapely
exact rectangle query: mixed geometries 256 viewports / 10k projected points, lines, polygons, and holes gometry 1.50 ms 1.18× faster1.77 ms Shapely
exact rectangle query: geographic geometries 256 viewports / 10k mixed EPSG:4326 geometries away from seams and poles gometry 1.47 ms 1.19× faster1.74 ms Shapely
index build 10k polygons gometry 892.02 us 1.40× faster1.24 ms Shapely

† geodesic/ellipsoidal metric. ‡ gometry uses its admitted in-core projection path; this is not a claim about arbitrary CRS transforms.

Reference implementations

Ellipsoidal area and length along straight longitude/latitude edges are compared with a Python/NumPy quadrature reference.

API / inputgometryComparator
ellipsoidal chart-edge country area 217 countries gometry 1.49 ms 86.52× faster128.80 ms Python/NumPy quadrature reference
ellipsoidal chart-edge exterior length 1,034 exteriors / 16,135 vertices gometry 10.23 ms 16.18× faster165.79 ms Python/NumPy quadrature reference

Scaling

Each point is a median call time at the indicated input or output size. The shaded band spans the paired process blocks; it is not a confidence interval. The caption reports the median of the paired time ratios at the rightmost point. A ratio above 1 favors gometry; the verdict accounts for uncertainty.

Union of disjoint polygons

Disjoint unit squares on a grid.

Union of disjoint polygons. Median call times — 1000 geometries: gometry 2.96 ms, Shapely 26.86 ms; 4000 geometries: gometry 12.81 ms, Shapely 136.09 ms; 16000 geometries: gometry 56.32 ms, Shapely 694.62 ms.

Union of disjoint polygons. Median call times — 1000 geometries: gometry 2.96 ms, Shapely 26.86 ms; 4000 geometries: gometry 12.81 ms, Shapely 136.09 ms; 16000 geometries: gometry 56.32 ms, Shapely 694.62 ms.

At 16,000 geometries, the paired Shapely/gometry time ratio is 12.35× (gometry faster).

Intersection with many holes

Square shell with square holes, cut by a box.

Intersection with many holes. Median call times — 250 holes: gometry 326.99 us, Shapely 740.37 us; 1000 holes: gometry 1.28 ms, Shapely 2.96 ms; 4000 holes: gometry 5.17 ms, Shapely 12.49 ms.

Intersection with many holes. Median call times — 250 holes: gometry 326.99 us, Shapely 740.37 us; 1000 holes: gometry 1.28 ms, Shapely 2.96 ms; 4000 holes: gometry 5.17 ms, Shapely 12.49 ms.

At 4,000 holes, the paired Shapely/gometry time ratio is 2.42× (gometry faster).

union_all service areas

1024 service areas.

union_all service areas. Median call times — 64 geometries: gometry 986.88 us, Shapely 1.67 ms; 256 geometries: gometry 4.59 ms, Shapely 6.75 ms; 1024 geometries: gometry 19.70 ms, Shapely 26.69 ms.

union_all service areas. Median call times — 64 geometries: gometry 986.88 us, Shapely 1.67 ms; 256 geometries: gometry 4.59 ms, Shapely 6.75 ms; 1024 geometries: gometry 19.70 ms, Shapely 26.69 ms.

At 1,024 geometries, the paired Shapely/gometry time ratio is 1.36× (gometry faster).

Point-in-polygon queries

Repeated coordinate queries against a prepared polygon with three holes.

Point-in-polygon queries. Median call times — 1000 probes: gometry 29.37 us, Shapely 63.85 us; 10000 probes: gometry 383.71 us, Shapely 791.40 us; 100000 probes: gometry 3.94 ms, Shapely 7.94 ms.

Point-in-polygon queries. Median call times — 1000 probes: gometry 29.37 us, Shapely 63.85 us; 10000 probes: gometry 383.71 us, Shapely 791.40 us; 100000 probes: gometry 3.94 ms, Shapely 7.94 ms.

At 100,000 probes, the paired Shapely/gometry time ratio is 2.02× (gometry faster).

Spherical real-boundary prepared queries

10k country-derived POIs / South Africa mainland, island and hole.

Spherical real-boundary prepared queries. Median call times — 1000 points: gometry 85.63 us, Spherely 255.43 us; 4000 points: gometry 307.56 us, Spherely 1.00 ms; 10000 points: gometry 744.42 us, Spherely 2.55 ms.

Spherical real-boundary prepared queries. Median call times — 1000 points: gometry 85.63 us, Spherely 255.43 us; 4000 points: gometry 307.56 us, Spherely 1.00 ms; 10000 points: gometry 744.42 us, Spherely 2.55 ms.

At 10,000 points, the paired Spherely/gometry time ratio is 3.42× (gometry faster).

Spherical prepared point-in-region

12k interior and exterior points / spherical great-circle polygon.

Spherical prepared point-in-region. Median call times — 1000 points: gometry 99.70 us, Spherely 594.18 us; 4000 points: gometry 397.55 us, Spherely 2.36 ms; 12000 points: gometry 1.18 ms, Spherely 7.25 ms.

Spherical prepared point-in-region. Median call times — 1000 points: gometry 99.70 us, Spherely 594.18 us; 4000 points: gometry 397.55 us, Spherely 2.36 ms; 12000 points: gometry 1.18 ms, Spherely 7.25 ms.

At 12,000 points, the paired Spherely/gometry time ratio is 6.02× (gometry faster).

Spherical point-pair distance

10k point pairs / explicit 6371000 metre sphere.

Spherical point-pair distance. Median call times — 1 pair: gometry 1.18 us, Spherely 1.71 us; 100 pairs: gometry 28.90 us, Spherely 40.97 us; 10000 pairs: gometry 2.77 ms, Spherely 3.94 ms.

Spherical point-pair distance. Median call times — 1 pair: gometry 1.18 us, Spherely 1.71 us; 100 pairs: gometry 28.90 us, Spherely 40.97 us; 10000 pairs: gometry 2.77 ms, Spherely 3.94 ms.

At 10,000 pairs, the paired Spherely/gometry time ratio is 1.42× (gometry faster).

Spherical line length by vertex count

Brazil boundary sampled at increasing vertex counts on a 6371000 metre sphere.

Spherical line length by vertex count. Median call times — 16 vertices: gometry 959.7 ns, Spherely 1.28 us; 128 vertices: gometry 1.11 us, Spherely 2.32 us; 1024 vertices: gometry 5.93 us, Spherely 11.24 us.

Spherical line length by vertex count. Median call times — 16 vertices: gometry 959.7 ns, Spherely 1.28 us; 128 vertices: gometry 1.11 us, Spherely 2.32 us; 1024 vertices: gometry 5.93 us, Spherely 11.24 us.

At 1,024 vertices, the paired Spherely/gometry time ratio is 1.87× (gometry faster).

Viewport selection, refinement and export

256 chart roads / source selection / 10m whole-shape target / clipped WKB.

Viewport selection, refinement and export. Median call times — 2 metres: gometry 761.09 us, GeoPandas + Shapely + pyproj 1.78 ms; 10 metres: gometry 590.79 us, GeoPandas + Shapely + pyproj 1.51 ms; 50 metres: gometry 695.47 us, GeoPandas + Shapely + pyproj 1.39 ms.

Viewport selection, refinement and export. Median call times — 2 metres: gometry 761.09 us, GeoPandas + Shapely + pyproj 1.78 ms; 10 metres: gometry 590.79 us, GeoPandas + Shapely + pyproj 1.51 ms; 50 metres: gometry 695.47 us, GeoPandas + Shapely + pyproj 1.39 ms.

At 50 metres, the paired GeoPandas + Shapely + pyproj/gometry time ratio is 2.00× (gometry faster).

tile_cover bbox

Brazil z10 / 15,340 tiles.

tile_cover bbox. Median call times — 990 tiles: gometry 19.44 us, Mercantile 248.62 us; 3960 tiles: gometry 59.47 us, Mercantile 1.09 ms; 15340 tiles: gometry 197.68 us, Mercantile 4.47 ms.

tile_cover bbox. Median call times — 990 tiles: gometry 19.44 us, Mercantile 248.62 us; 3960 tiles: gometry 59.47 us, Mercantile 1.09 ms; 15340 tiles: gometry 197.68 us, Mercantile 4.47 ms.

At 15,340 tiles, the paired Mercantile/gometry time ratio is 22.54× (gometry faster).

Index queries as the index grows

1,000 queries against a growing polygon index.

Bounding-box candidates, without exact predicate refinement.

Index queries as the index grows. Median call times — 1000 polygons: gometry 45.97 us, Shapely 64.58 us; 5000 polygons: gometry 57.31 us, Shapely 92.34 us; 10000 polygons: gometry 57.85 us, Shapely 105.79 us.

Index queries as the index grows. Median call times — 1000 polygons: gometry 45.97 us, Shapely 64.58 us; 5000 polygons: gometry 57.31 us, Shapely 92.34 us; 10000 polygons: gometry 57.85 us, Shapely 105.79 us.

At 10,000 polygons, the paired Shapely/gometry time ratio is 1.83× (gometry faster).

Index queries returning more candidates

One query returning a growing number of candidates.

Bounding-box candidates, without exact predicate refinement.

Index queries returning more candidates. Median call times — 1 pair/query: gometry 446.6 ns, Shapely 625.4 ns; 10 pairs/query: gometry 470.6 ns, Shapely 976.9 ns; 100 pairs/query: gometry 921.4 ns, Shapely 1.73 us.

Index queries returning more candidates. Median call times — 1 pair/query: gometry 446.6 ns, Shapely 625.4 ns; 10 pairs/query: gometry 470.6 ns, Shapely 976.9 ns; 100 pairs/query: gometry 921.4 ns, Shapely 1.73 us.

At 100 pairs/query, the paired Shapely/gometry time ratio is 1.89× (gometry faster).

Index queries by hit rate

1,000 queries against 10,000 indexed polygons.

Bounding-box candidates, without exact predicate refinement.

Index queries by hit rate. Median call times — 0.01 fraction: gometry 9.28 us, Shapely 12.77 us; 0.1 fraction: gometry 12.41 us, Shapely 21.64 us; 0.5 fraction: gometry 30.95 us, Shapely 57.68 us.

Index queries by hit rate. Median call times — 0.01 fraction: gometry 9.28 us, Shapely 12.77 us; 0.1 fraction: gometry 12.41 us, Shapely 21.64 us; 0.5 fraction: gometry 30.95 us, Shapely 57.68 us.

At 50%, the paired Shapely/gometry time ratio is 1.87× (gometry faster).

Methodology

Paired measurements alternate which library runs first. Outputs are checked for equivalent rows, types, coordinates, and topology before timing. Where gometry performs stricter work than a comparator—such as exact arithmetic predicates and overlay, occupied-support semantics, automatic coverage validation in coverage_union_all, geographic domain admission, or retaining full feature properties and IDs in from_geojson—those guarantees stay enabled during timing rather than being bypassed for benchmark parity.

A separate MVT profile compares tile-local to_mvt encoding and from_mvt decoding with the Python mapbox-vector-tile package, using point and mixed-geometry layers. These codec measurements start with prepared tile-local geometry; source selection, projection, and clipping are outside their timing boundary. Encoding and decoding compare equivalent values, while their Python result representations differ.

Ratios summarize paired call times. Labels use confidence intervals with at least 95% coverage and a 3% practical-equivalence margin:

Label Meaning
Faster / slower The entire interval is beyond the 3% margin.
Similar The entire interval is within the margin.
Inconclusive The interval is too wide or crosses a decision boundary.

Timings use one pinned CPU. Paired blocks reduce shared host drift; they do not remove the effects of CPU frequency changes or contention.

Run environment

Measured on AMD Ryzen 9 5950X 16-Core Processor with Linux 7.3.6 and CPython 3.14.8. Benchmark harness commit: a8077817.

Versions: GeoPandas 1.2.0, gometry 2.0.0, h3-py 4.5.0, mapbox-vector-tile 2.2.0, Mercantile 1.2.1, NumPy 2.5.4, pyarrow 26.0.0, pygeohash 3.5.1, pyproj 3.8.0, Shapely 2.2.0, Spherely 0.1.1, GEOS 3.14.1, PROJ 9.8.1.

Each workload used 6–12 independent paired process blocks, with 2 warm-up calls and 5 measured calls per implementation in each block.

Run the comparisons yourself with the gometry benchmark harness.