-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: Infrastructure
-
None
Context
By using fine-grained locks in the connection pool, we can reduce the rate of lock contention and improve overall throughput.
From testing related to PYTHON-5007, using fine-grained locks improved thread efficiency by about 20% in a small read scenario. It showed improvement with free-threading enabled.
There is a proof of concept in https://github.com/blink1073/mongo-python-driver/pull/10 .
Definition of done
Implement fine-grained locks in the connection pool and ensure that there are no regressions in behavior. Verify improvements to small reads in async and sync with and without the GIL enabled.
Pitfalls
Ensure that we do not regress in resource protection.
- is related to
-
PYTHON-5007 Investigate ways to improve performance of small read operations
-
- Closed
-
- related to
-
PYTHON-5672 Refactor connection checkout to reduce layers
-
- Backlog
-