pysal / libpysal

Core components of Python Spatial Analysis Library
http://pysal.org/libpysal
Other
249 stars 79 forks source link

PERF: sorting-related improvements in Graph #715

Closed martinfleis closed 1 month ago

martinfleis commented 1 month ago

I've done some profiling which led to these changes.

We still do sorting multiple times in many places but if I short-circuit that, we hit #687 and issues with sparse round tripping. The final sorting either needs to happen in __init__ as now or would need to happen in .sparse. Keeping it in the constructor is probably better idea as we know that a Graph is always correct as is.