Skip to main content

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 the boto lib. - psycopg2 json to ujson 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 for decimal patch activation - set AUTOWRAPT_BOOTSTRAP=psycopg2 env variable for psycopg2 patch activation - set AUTOWRAPT_BOOTSTRAP=dynamodb env variable for dynamodb 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.

Files for decimal-monkeypatch, version 0.4.3
Filename, size File type Python version Upload date Hashes
Filename, size decimal_monkeypatch-0.4.3-py2-none-any.whl (9.0 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size decimal-monkeypatch-0.4.3.tar.gz (5.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page