lru_cache can speed up many functions calls to py_tools_ds
Many lower-level functions within arosics
and py_tools_ds
get called thousands of times with the same input, since all GCP tiles have the same projection.
One example is prj_equal
in py_tools_ds.geo.projection
.
A simple way to speed up those calls is by using a lru_cache
decorator.
import functools
@functools.lru_cache
def prj_equal(prj1, prj2):
A more fundamental improvement would be to remove some of these checks for the individual tile COREG
classes, similar to the nodata
check.