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 / input | gometry | Comparator |
|---|---|---|
| from_wkb mixed EWKB 10k mixed EWKB | gometry 1.52 ms 1.61× faster | 2.45 ms Shapely |
| from_arrow mixed GeoArrow WKB 100k mixed GeoArrow WKB / 10% missing | gometry 12.60 ms 1.96× faster | 24.38 ms GeoPandas |
| to_wkb mixed EWKB 10k mixed EWKB | gometry 712.03 us 4.22× faster | 3.01 ms Shapely |
| coords matrix and row_index 100k vertices / float64 matrix + int64 row index | gometry 117.63 us 3.54× faster | 415.16 us Shapely |
| points from NumPy XY 10k NumPy XY | gometry 5.14 us 211.49× faster | 1.08 ms Shapely |
| from WKT mixed geometries 10k realistic mixed WKT | gometry 4.14 ms 3.19× faster | 13.14 ms Shapely |
| from GeoJSON countries 217 countries / 2.26 MB / ordered geometry, properties and ID rows | gometry 14.12 ms 2.04× faster | 28.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× faster | 27.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× faster | 22.63 ms GeoPandas + Shapely |
Geometry¶
| API / input | gometry | Comparator |
|---|---|---|
| intersects irregular polygon points 12k interior, boundary, and exterior probes | gometry 1.40 ms 1.99× faster | 2.78 ms Shapely |
| prepared polygon contains coordinate probes 100k probes / 1,316-coordinate holed polygon | gometry 3.96 ms 2.01× faster | 7.98 ms Shapely |
| dwithin pairwise 10k pairs / 50% matches | gometry 4.55 us 44.85× faster | 203.53 us Shapely |
| area projected buildings 10k projected buildings | gometry 153.32 us 1.13× faster | 173.42 us Shapely |
| length roads 10k roads / 100k vertices | gometry 135.45 us 1.45× faster | 195.48 us Shapely |
| simplify Douglas-Peucker 10k roads / 100k vertices | gometry 779.04 us 5.20× faster | 4.05 ms Shapely |
| buffer projected points 10k projected points | gometry 2.12 ms 22.01× faster | 46.85 ms Shapely |
| intersection pairwise 1k irregular polygon pairs | gometry 4.56 ms 1.48× faster | 6.77 ms Shapely |
| intersects pairwise polygons 1k irregular polygon pairs | gometry 391.02 us 1.43× faster | 559.20 us Shapely |
| coverage_union_all parcels 10k edge-matched parcels | gometry 1.94 ms 2.68× faster | 5.20 ms Shapely |
| Fixed-precision district dissolve 512 overlapping parcel footprints in 32 districts / 1 m grid | gometry 10.33 ms Inconclusive | 10.28 ms GeoPandas |
| is_valid mixed polygons 10k mixed polygons / 20% invalid | gometry 4.88 ms 1.88× faster | 9.11 ms Shapely |
| repair linework 1k invalid polygons | gometry 10.14 ms 8.77× faster | 90.88 ms Shapely |
| bounds projected buildings 10k projected buildings | gometry 63.40 us 2.57× faster | 163.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× faster | 44.36 ms Shapely |
| point_on_surface buildings 10k concave and holed buildings | gometry 1.03 ms 2.07× faster | 2.13 ms Shapely |
| Spherical real-boundary load and query WKB admission, preparation and 10k country-derived POIs | gometry 4.00 ms 1.50× slower | 2.67 ms Spherely |
| Spherical load and query WKB polygon admission, preparation and 12k point queries | gometry 1.23 ms 5.84× faster | 7.27 ms Spherely |
| Spherical intersection and serialization 4 distinct aligned and oblique great-circle polygon pairs / WKB output | gometry 166.19 us 3.02× slower | 55.33 us Spherely |
CRS & geodesy¶
| API / input | gometry | Comparator |
|---|---|---|
| to_space masked points 200k points / 10% missing ‡ | gometry 10.82 ms 6.80× faster | 74.48 ms GeoPandas |
| Transform stored road vertices 10k UTM roads / 100k vertices / vertex-only EPSG:4326 conversion ‡ | gometry 10.65 ms 1.69× faster | 18.03 ms GeoPandas |
| crs_transform WGS84 to Web Mercator 10k EPSG:4326 to 3857 | gometry 315.92 us 2.43× faster | 767.57 us pyproj |
| geodesic distance 10k WGS84 pairs † | gometry 7.50 ms 1.06× faster | 7.96 ms pyproj |
| geodesic destination 10k WGS84 destinations † | gometry 3.28 ms 1.28× faster | 4.20 ms pyproj + Shapely + GeoPandas |
| Spherical area of Brazil OSM Brazil / explicit 6371000 metre sphere / great-circle edges | gometry 20.37 us 1.44× faster | 29.21 us Spherely |
Discrete global grids¶
| API / input | gometry | Comparator |
|---|---|---|
| geohash encode tokens 10k WGS84 points / precision 6 | gometry 600.94 us 7.43× faster | 4.48 ms pygeohash |
| h3 cover center Brazil Brazil res5 / 32,260 cells | gometry 24.31 ms 1.25× faster | 30.42 ms h3-py |
| h3_compact 32,260 to 1,732 cells | gometry 136.20 us 3.97× faster | 544.71 us h3-py |
Spatial index¶
| API / input | gometry | Comparator |
|---|---|---|
| one-shot join within 10k POIs x 217 countries | gometry 4.35 ms 6.69× faster | 29.31 ms Shapely |
| index join within 10k POIs x 217 countries | gometry 3.53 ms 8.40× faster | 29.68 ms Shapely |
| index candidates 1k queries x 10k polygons | gometry 988.44 us 4.66× faster | 4.64 ms Shapely |
| index nearest k=1 1k non-intersecting queries x 10k polygons | gometry 2.43 ms 2.09× faster | 5.07 ms Shapely |
| exact rectangle query: packed points 256 viewports / 10k projected points / varied hit counts | gometry 225.80 us 7.02× faster | 1.58 ms Shapely |
| exact rectangle query: mixed geometries 256 viewports / 10k projected points, lines, polygons, and holes | gometry 1.50 ms 1.18× faster | 1.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× faster | 1.74 ms Shapely |
| index build 10k polygons | gometry 892.02 us 1.40× faster | 1.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 / input | gometry | Comparator |
|---|---|---|
| ellipsoidal chart-edge country area 217 countries | gometry 1.49 ms 86.52× faster | 128.80 ms Python/NumPy quadrature reference |
| ellipsoidal chart-edge exterior length 1,034 exteriors / 16,135 vertices | gometry 10.23 ms 16.18× faster | 165.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.
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.
At 4,000 holes, the paired Shapely/gometry time ratio is 2.42× (gometry faster).
union_all service areas¶
1024 service areas.
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.
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.
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.
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.
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.
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.
At 50 metres, the paired GeoPandas + Shapely + pyproj/gometry time ratio is 2.00× (gometry faster).
tile_cover bbox¶
Brazil z10 / 15,340 tiles.
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.
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.
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.
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.