Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shapely 2.0: Check performance for scalar methods/attributes #1021

Open
jorisvandenbossche opened this issue Nov 6, 2020 · 0 comments
Open

Comments

@jorisvandenbossche
Copy link
Member

See discussion at #983 (comment), repeating my summary here:

In general: yes, there is a slowdown for methods/properties of scalar Geometry objects.
For some things (like the constructors of the different geometry classes), we can optimize this by spending some effort in having an efficient single-geometry version (this can probably be done in the class constructor itself, eg by using pygeos.lib.points instead of pygeos.points).
But for the bulk of the ufuncs (the spatial predicates, operations, etc., i.e. those that directly wrap one of the GEOS<..op..>_r functions), this is the consequence of having general ufunc (array-aware) functions. This ufunc machinery will always have some overhead, and for single geometries this overhead can be noticeable (and seems to be larger as the benefit from not using ctypes).

So I think that generally speaking we can live with a small additional overhead (given that the vectorized operations will be much faster), but we should of course still fix the slowdown where easily possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant