Skip to content

2.1 Polygon creation is much slower than 2.0.7 #2280

@dbestPacksol

Description

@dbestPacksol

It seems to be that creating Polygons in 2.1 is much slower (roughly 5-10x) slower than 2.0.7.

The following script takes roughly 0.1 seconds with Shapely 2.1 and 0.015 with Shapely 2.0.7. This is on Python 3.12

import time

import shapely

if name == "main":

start_time = time.time()
for _ in range(1000):
    coords = ((0., 0.), (0., 1.), (1., 1.), (1., 0.), (0., 0.))
    polygon = shapely.Polygon(coords)

print(time.time() - start_time)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions