A ranking algorithm I'm developing for a Django webapp requires performing spatial operations (within, intersections, sym_difference, etc.) using a query against large number of geometry objects.
Presently, the algorithm is very time-consuming, and the profiler reveals that the bottleneck is django.contrib.gis.geos.prototypes.threadsafe.__call__, which are called by virtually every methods in GEOSGeometry. From what I understand, threadsafe.py is a wrapper to the underlying GEOS's threadsafe API.
In this case the threadsafe-checking presents huge overhead to the computation time. Also my computation is strictly single threaded. From these reasons, I wonder is it possible to bypass or avoid the thread-safety checking performing by Django's GEOS API?