Shapely 2 exposes a shapely.polygons function which can create large numbers of polygons directly from numpy arrays. This gives a dramatic performance improvement, varying by dataset type. For UGRID I have seen the time taken to construct the polygons halve, for large CF grids the time has dropped from ~6 seconds to ~0.1 second.
This makes #40 irrelevant. This was found when investigating caching strategies. The slow down was always in constructing the polygons not in calculating vertices, and polygons still have to be constructed when loading them from the cache.
Shapely 2 exposes a
shapely.polygons
function which can create large numbers of polygons directly from numpy arrays. This gives a dramatic performance improvement, varying by dataset type. For UGRID I have seen the time taken to construct the polygons halve, for large CF grids the time has dropped from ~6 seconds to ~0.1 second.This makes #40 irrelevant. This was found when investigating caching strategies. The slow down was always in constructing the polygons not in calculating vertices, and polygons still have to be constructed when loading them from the cache.