pyproj
pyproj copied to clipboard
PERF: Thread-local global contex
From: https://github.com/shapely/shapely/issues/1523#issuecomment-1237347057
Sounds like a good idea to look into seeing if https://docs.python.org/3/c-api/init.html#thread-local-storage-support would allow always using a thead-local global context instead of enabling a single global version (https://pyproj4.github.io/pyproj/stable/api/global_context.html).
Also see:
- https://peps.python.org/pep-0539/
- https://github.com/cython/cython/blob/efdf996dced075682d86b7e53a12b56b5ebfea38/tests/run/tss.pyx