Python 2 performance patches: decimal to cdecimal, json to ujson for psycopg2
Project description
decimal-monkeypatch
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.
Usage
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
Additional reading
- Swapping decimal for cdecimal on Python 2
- Automatic patching of Python applications
- Discussion about json module selection in psycopg2
- SO deepcopy question
WARNING
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file decimal-monkeypatch-0.4.2.tar.gz
.
File metadata
- Download URL: decimal-monkeypatch-0.4.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.0 CPython/2.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 407d5fc4a3eb917f01efd0f91693a51cf23ad84dbc5fb0ff5c340b6d7e2c8175 |
|
MD5 | 54a4da7f7c9de8e2f132fc4ed1720815 |
|
BLAKE2b-256 | 10d83e0fd1cff536e7e75c13a03059cec7fb4aecb303535bb082dcfc18e03f29 |
File details
Details for the file decimal_monkeypatch-0.4.2-py2-none-any.whl
.
File metadata
- Download URL: decimal_monkeypatch-0.4.2-py2-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.0 CPython/2.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c90c14906d93c61a6d2d4defda57b077e39807fcdede85752ca61a4ec1f15aad |
|
MD5 | c19c9c08b46674c6f88ad5e3d8a3585f |
|
BLAKE2b-256 | 6b7de4b0b7dc8a81a021f1a684cee719584940a8632bf8cb3758bff9073f58d8 |