A Python module based on autowrapt for:
- Interpreter-wide monkey patching slow
decimal
module to cdecimal on Python 2 with preservation of the functionality of theboto
lib. psycopg2
json
toujson
replacement- Custom
deepcopy
for boto.dynamodb2.items. This patch can give huge performance benefits if you know expected data structure.
pip install decimal-monkeypatch
- set
AUTOWRAPT_BOOTSTRAP=decimal
env variable fordecimal
patch activation - set
AUTOWRAPT_BOOTSTRAP=psycopg2
env variable forpsycopg2
patch activation - set
AUTOWRAPT_BOOTSTRAP=dynamodb
env variable fordynamodb
patch activation - set
AUTOWRAPT_BOOTSTRAP=decimal,psycopg2,dynamodb
for all at once
- Swapping decimal for cdecimal on Python 2
- Automatic patching of Python applications
- Discussion about json module selection in psycopg2
- SO deepcopy question
Tested on only this configuration:
Python 2.7.12+
boto
2.48.0
m3-cdecimal
2.3
psycopg2-binary
2.7.4
ujson
1.35