In _cbsonmodule.c, the INT2STRING macro is used during serialization. In my workload (heavily nested documents with large array fields), this macro becomes somewhat of a performance bottleneck. By swapping the macro for a more purpose-built function like this one by the MySQL team I was able to significantly improve performance. After applying the optimization mentioned in PYTHON-3717), this tweak netted me an additional 2x speed-up on my `insert_one` calls.
- related to
-
PYTHON-3819 Optimize BSON encoding/decoding performance
- Released
-
PYTHON-3717 Speed up _type_marker check in BSON
- Closed