-
Type:
Bug
-
Resolution: Won't Do
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Python Drivers
-
None
-
None
-
None
-
None
-
None
-
None
There seems to be a BSON performance regression in Python 3.12. Discovered because PYTHON-5203 just upgraded our perf benchmarks from Python 3.10 to 3.13 and multiple BSON benchmarks dropped by 40%:
https://spruce.mongodb.com/task/mongo_python_driver_perf_tests_perf_8.0_standalone_e6e8650cc95314e742a30244b5db0239f5259f68_25_03_13_19_08_41/trend-charts?execution=0&sortBy=STATUS&sortDir=ASC
I can reproduce a regression in Python 3.12 and Python3.13 locally as well. Here's 3.10:
platform darwin -- Python 3.10.11, pytest-8.3.5, pluggy-1.5.0 -- /Users/shane/work/pycharm/pymongo-py310/bin/python ... test/performance/perf_test.py::TestFlatEncoding::runTest Completed TestFlatEncoding 660.347 MB/s, MEDIAN=0.009s, total time=0.100s, iterations=10
3.11:
platform darwin -- Python 3.11.4, pytest-8.3.4, pluggy-1.5.0 -- /Users/shane/work/pycharm/pymongo-py311/bin/python ... test/performance/perf_test.py::TestFlatEncoding::runTest Completed TestFlatEncoding 657.964 MB/s, MEDIAN=0.009s, total time=0.101s, iterations=10
3.12:
platform darwin -- Python 3.12.4, pytest-8.3.3, pluggy-1.5.0 -- /Users/shane/work/pycharm/pymongo-py312/bin/python ... test/performance/perf_test.py::TestFlatEncoding::runTest Completed TestFlatEncoding 489.287 MB/s, MEDIAN=0.012s, total time=0.110s, iterations=8
3.13:
platform darwin -- Python 3.13.0, pytest-8.3.4, pluggy-1.5.0 -- /Users/shane/work/pycharm/pymongo-3.13/bin/python ... test/performance/perf_test.py::TestFlatEncoding::runTest Completed TestFlatEncoding 516.190 MB/s, MEDIAN=0.012s, total time=0.106s, iterations=8
- related to
-
PYTHON-5737 BSON encoding/decoding performance improvements
-
- In Code Review
-