Skip to content

Commit 0eb580e

Browse files
committed
1.2.0
1 parent 0ef8d84 commit 0eb580e

16 files changed

Lines changed: 71 additions & 38 deletions

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
# Changelog
22

3+
## 1.2.0 - 2018-12-16
4+
5+
### Changed
6+
7+
- Performance improvements.
8+
39
## 1.1.0 - 2018-12-04
410

511
### Changed
612

713
- Performance improvements.
814

15+
### Fixed
16+
17+
- Dict key can only be str.
18+
919
## 1.0.1 - 2018-11-26
1020

1121
### Fixed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "orjson"
3-
version = "1.1.0"
3+
version = "1.2.0"
44
authors = []
55
description = "Fast Python JSON library"
66
edition = '2018'

README.md

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# orjson
22

33
orjson is a fast JSON library for Python. It benchmarks as the fastest Python
4-
library for JSON serialization, about twice as fast or more as the nearest
5-
other library, with deserialization performance slightly worse to similar to
6-
the fastest library.
4+
library for JSON serialization, with 1.6x to 2.6x the performance as the nearest
5+
other library, with deserialization performance of 0.95x to 1.2x
6+
the nearest other library.
77

88
It supports CPython 3.5, 3.6, and 3.7. It is not intended
99
as a drop-in replacement for the standard library's json module.
@@ -22,8 +22,8 @@ To build a release wheel from source, assuming a Rust nightly toolchain
2222
and Python environment:
2323

2424
```sh
25-
git checkout https://github.com/ijl/orjson.git && cd orjson
26-
git submodule init && git submodule update
25+
git clone --recurse-submodules https://github.com/ijl/orjson.git && cd orjson
26+
virtualenv .venv && source .venv/bin/activate
2727
pip install --upgrade pyo3-pack
2828
pyo3-pack build --release --strip --interpreter python3.7
2929
```
@@ -108,67 +108,90 @@ multithreaded. It also uses some tests from the ultrajson library.
108108
## Performance
109109

110110
Serialization performance of orjson is better than ultrajson, rapidjson, or
111-
json. Deserialization performance is worse to about the same as ultrajson.
111+
json. Deserialization performance is better to about the same as ultrajson.
112112

113-
![alt text](doc/twitter-serialize.png "twitter.json serialization")
114-
![alt text](doc/citm_catalog-serialize.png "citm_catalog.json serialization")
115-
![alt text](doc/canada-serialize.png "canada.json serialization")
113+
![alt text](doc/twitter_serialization.png "twitter.json serialization")
114+
![alt text](doc/twitter_deserialization.png "twitter.json deserialization")
115+
![alt text](doc/citm_catalog_serialization.png "citm_catalog.json serialization")
116+
![alt text](doc/citm_catalog_deserialization.png "citm_catalog.json deserialization")
117+
![alt text](doc/github_serialization.png "github.json serialization")
118+
![alt text](doc/github_deserialization.png "github.json deserialization")
119+
![alt text](doc/canada_serialization.png "canada.json serialization")
120+
![alt text](doc/canada_deserialization.png "canada.json deserialization")
116121

117122
#### canada.json deserialization
118123

119124
| Library | Median (milliseconds) | Operations per second | Relative (latency) |
120125
|-----------|-------------------------|-------------------------|----------------------|
121-
| orjson | 8.72 | 114.8 | 1.25 |
122-
| ujson | 6.95 | 138.4 | 1 |
123-
| rapidjson | 27.75 | 36 | 3.99 |
124-
| json | 27.22 | 36.6 | 3.92 |
126+
| orjson | 7.59 | 131.8 | 1 |
127+
| ujson | 7.26 | 133.5 | 0.96 |
128+
| rapidjson | 26.72 | 37.4 | 3.52 |
129+
| json | 26.78 | 37.3 | 3.53 |
125130

126131
#### canada.json serialization
127132

128133
| Library | Median (milliseconds) | Operations per second | Relative (latency) |
129134
|-----------|-------------------------|-------------------------|----------------------|
130-
| orjson | 5.12 | 195.4 | 1 |
131-
| ujson | 8.19 | 122.1 | 1.6 |
132-
| rapidjson | 44.48 | 22.5 | 8.69 |
133-
| json | 46.85 | 21.3 | 9.16 |
135+
| orjson | 4.99 | 200.3 | 1 |
136+
| ujson | 8.16 | 122.5 | 1.64 |
137+
| rapidjson | 43.27 | 23.1 | 8.67 |
138+
| json | 48.15 | 20.8 | 9.65 |
134139

135140
#### citm_catalog.json deserialization
136141

137142
| Library | Median (milliseconds) | Operations per second | Relative (latency) |
138143
|-----------|-------------------------|-------------------------|----------------------|
139-
| orjson | 6.06 | 164.9 | 1.12 |
140-
| ujson | 5.4 | 185.2 | 1 |
141-
| rapidjson | 7.26 | 137.6 | 1.35 |
142-
| json | 7.49 | 132.2 | 1.39 |
144+
| orjson | 5.05 | 198.2 | 1 |
145+
| ujson | 6.2 | 161.2 | 1.23 |
146+
| rapidjson | 6.57 | 152.2 | 1.3 |
147+
| json | 6.62 | 151.1 | 1.31 |
143148

144149
#### citm_catalog.json serialization
145150

146151
| Library | Median (milliseconds) | Operations per second | Relative (latency) |
147152
|-----------|-------------------------|-------------------------|----------------------|
148-
| orjson | 1.02 | 980.6 | 1 |
149-
| ujson | 2.53 | 394.4 | 2.49 |
150-
| rapidjson | 2.37 | 421.9 | 2.33 |
151-
| json | 5.32 | 188 | 5.22 |
153+
| orjson | 1 | 997.4 | 1 |
154+
| ujson | 2.54 | 394.1 | 2.53 |
155+
| rapidjson | 2.38 | 419.5 | 2.38 |
156+
| json | 5.26 | 190 | 5.25 |
157+
158+
#### github.json deserialization
159+
160+
| Library | Median (milliseconds) | Operations per second | Relative (latency) |
161+
|-----------|-------------------------|-------------------------|----------------------|
162+
| orjson | 0.23 | 4310.6 | 1 |
163+
| ujson | 0.23 | 4414.3 | 0.98 |
164+
| rapidjson | 0.23 | 4229.4 | 1 |
165+
| json | 0.23 | 4176.3 | 1 |
166+
167+
#### github.json serialization
168+
169+
| Library | Median (milliseconds) | Operations per second | Relative (latency) |
170+
|-----------|-------------------------|-------------------------|----------------------|
171+
| orjson | 0.06 | 16357.9 | 1 |
172+
| ujson | 0.13 | 7531.2 | 2.17 |
173+
| rapidjson | 0.16 | 6362.9 | 2.57 |
174+
| json | 0.23 | 4242.5 | 3.8 |
152175

153176
#### twitter.json deserialization
154177

155178
| Library | Median (milliseconds) | Operations per second | Relative (latency) |
156179
|-----------|-------------------------|-------------------------|----------------------|
157-
| orjson | 2.98 | 335.3 | 1.25 |
158-
| ujson | 2.39 | 419.3 | 1 |
159-
| rapidjson | 3.12 | 318.8 | 1.31 |
160-
| json | 3.12 | 318.8 | 1.31 |
180+
| orjson | 2.6 | 385.5 | 1 |
181+
| ujson | 2.98 | 336.5 | 1.15 |
182+
| rapidjson | 2.84 | 339.1 | 1.09 |
183+
| json | 2.84 | 345.9 | 1.09 |
161184

162185
#### twitter.json serialization
163186

164187
| Library | Median (milliseconds) | Operations per second | Relative (latency) |
165188
|-----------|-------------------------|-------------------------|----------------------|
166-
| orjson | 0.55 | 1815.1 | 1 |
167-
| ujson | 1.46 | 684.9 | 2.65 |
168-
| rapidjson | 1.55 | 643.9 | 2.82 |
169-
| json | 2.18 | 458.7 | 3.95 |
189+
| orjson | 0.56 | 1790 | 1 |
190+
| ujson | 1.44 | 693.9 | 2.58 |
191+
| rapidjson | 1.57 | 636.1 | 2.82 |
192+
| json | 2.21 | 452 | 3.96 |
170193

171-
This was measured using orjson 1.0.0 on Python 3.7.1. The above can be
194+
This was measured using orjson 1.2.0 on Python 3.7.1 and Linux. The above can be
172195
reproduced using the `pybench` and `graph` scripts.
173196

174197
## License

doc/canada-serialize.png

-16.8 KB
Binary file not shown.

doc/canada_deserialization.png

18.4 KB
Loading

doc/canada_serialization.png

16.8 KB
Loading

doc/citm_catalog-serialize.png

-17.6 KB
Binary file not shown.
19.4 KB
Loading

doc/citm_catalog_serialization.png

17.6 KB
Loading

0 commit comments

Comments
 (0)