-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: JSON, Performance
-
None
-
Not Needed
-
While working on PYTHON-1277 I've come to realize just how slow json_util is. We can definitely improve things:
- Allow applications to use simplejson instead of json. We currently only attempt to import simplejson with Python 2.6 for ordered dictionary support, but simplejson is often faster than the standard library json module.
- Provide dump and load helpers to go along with dumps and loads
- Use a single dispatch pattern with _type_marker to speed up json_util.default for BSON types.
- Use set intersection to quickly find the $ key (if any) for a BSON type in json_util.object_hook.
There are other fast JSON libraries for Python (cjson, ujson, rapidjson, etc.), but none of them provide the features we need for json_util (default, object_hook, object_pairs_hook, etc.).
- is depended on by
-
PYTHON-3835 Log informational message client-side based on detected environment (DocumentDB or CosmosDB)
- Closed
- is related to
-
PYTHON-4593 Use simplejson to improve performance of json_util
- Backlog
-
PYTHON-4125 And benchmark for JSON encoding/decoding
- Closed
-
PYTHON-3395 Make ObjectId properly convert when being served from a rest API
- Closed
-
PYTHON-4143 Optimize JSON encoding of int, float, str, and None
- Closed
-
PYTHON-4144 Optimize json_util encoding performance using single dispatch table
- Closed
-
PYTHON-4179 Optimize JSON decoding performance by avoiding object_pairs_hook
- Closed
-
PYTHON-4204 Optimize JSON decoding using set intersection and lookup table
- Closed
- related to
-
PYTHON-3113 Easier debugging with standardized logging
- Development Complete
-
PYTHON-3457 Easier debugging with standardized logging: logging specification
- Closed