Skip to content

Commit ac88b2b

Browse files
committed
cargo, rust update
1 parent ab45310 commit ac88b2b

16 files changed

Lines changed: 142 additions & 107 deletions

Cargo.lock

Lines changed: 17 additions & 14 deletions
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
@@ -55,7 +55,7 @@ encoding_rs = { version = "0.8", default_features = false, features = ["simd-acc
5555
inlinable_string = { version = "0.1" }
5656
itoa = { version = "0.4", default_features = false }
5757
once_cell = { version = "1", default_features = false }
58-
pyo3 = { version = "0.11", default_features = false, features = ["extension-module"]}
58+
pyo3 = { version = "0.12", default_features = false, features = ["extension-module"]}
5959
ryu = { version = "1" }
6060
serde = { version = "1", default_features = false }
6161
serde_json = { path = "./json", default_features = false, features = ["std"] }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ maturin build --no-sdist --release --strip --manylinux off
11361136
```
11371137

11381138
Problems with the Rust nightly channel may require pinning a version.
1139-
`nightly-2020-06-09` is known to be ok.
1139+
`nightly-2020-09-14` is known to be ok.
11401140

11411141
orjson is tested for amd64 and aarch64 on Linux, macOS, and Windows. It
11421142
may not work on 32-bit targets. It should be compiled with

ci/azure-pipelines.yml

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pr:
44
- '*'
55

66
variables:
7-
toolchain: nightly-2020-07-01
7+
toolchain: nightly-2020-09-14
88

99
jobs:
1010

@@ -156,7 +156,7 @@ jobs:
156156
pool:
157157
vmImage: windows-2019
158158
variables:
159-
interpreter: C:\hostedtoolcache\windows\Python\3.7.8\x64\python.exe
159+
interpreter: C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe
160160
target: x86_64-pc-windows-msvc
161161
steps:
162162
- task: UsePythonVersion@0
@@ -181,45 +181,3 @@ jobs:
181181
architecture: 'x64'
182182
- checkout: self
183183
- template: ./azure-win.yml
184-
185-
- job: linux_python38_amd64_manylinux1
186-
pool:
187-
vmImage: ubuntu-20.04
188-
container: quay.io/pypa/manylinux1_x86_64:latest
189-
variables:
190-
interpreter: python3.8
191-
manylinux: 1
192-
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp38-cp38/bin:/opt/rh/devtoolset-2/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
193-
target: x86_64-unknown-linux-gnu
194-
verifyManylinux: true
195-
steps:
196-
- checkout: self
197-
- template: ./azure-linux-container.yml
198-
199-
- job: linux_python37_amd64_manylinux1
200-
pool:
201-
vmImage: ubuntu-20.04
202-
container: quay.io/pypa/manylinux1_x86_64:latest
203-
variables:
204-
interpreter: python3.7
205-
manylinux: 1
206-
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp37-cp37m/bin:/opt/rh/devtoolset-2/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
207-
target: x86_64-unknown-linux-gnu
208-
verifyManylinux: true
209-
steps:
210-
- checkout: self
211-
- template: ./azure-linux-container.yml
212-
213-
- job: linux_python36_amd64_manylinux1
214-
pool:
215-
vmImage: ubuntu-20.04
216-
container: quay.io/pypa/manylinux1_x86_64:latest
217-
variables:
218-
interpreter: python3.6
219-
manylinux: 1
220-
path: /home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/opt/python/cp36-cp36m/bin:/opt/rh/devtoolset-2/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
221-
target: x86_64-unknown-linux-gnu
222-
verifyManylinux: true
223-
steps:
224-
- checkout: self
225-
- template: ./azure-linux-container.yml

ci/drone.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ steps:
1414
TWINE_PASSWORD:
1515
from_secret: twine_password
1616
commands:
17-
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-07-01 --profile minimal -y
17+
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-09-14 --profile minimal -y
1818
- python3.9 -m pip install --upgrade pip maturin
1919
- maturin build --no-sdist --release --strip --manylinux 2014 --interpreter python3.9
2020
- python3.9 -m pip install target/wheels/orjson*.whl
@@ -38,7 +38,7 @@ steps:
3838
TWINE_PASSWORD:
3939
from_secret: twine_password
4040
commands:
41-
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-07-01 --profile minimal -y
41+
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-09-14 --profile minimal -y
4242
- python3.8 -m pip install --upgrade pip maturin
4343
- maturin build --no-sdist --release --strip --manylinux 2014 --interpreter python3.8
4444
- python3.8 -m pip install target/wheels/orjson*.whl
@@ -62,7 +62,7 @@ steps:
6262
TWINE_PASSWORD:
6363
from_secret: twine_password
6464
commands:
65-
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-07-01 --profile minimal -y
65+
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-09-14 --profile minimal -y
6666
- python3.7 -m pip install --upgrade pip maturin
6767
- maturin build --no-sdist --release --strip --manylinux 2014 --interpreter python3.7
6868
- python3.7 -m pip install target/wheels/orjson*.whl
@@ -86,7 +86,7 @@ steps:
8686
TWINE_PASSWORD:
8787
from_secret: twine_password
8888
commands:
89-
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-07-01 --profile minimal -y
89+
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-09-14 --profile minimal -y
9090
- python3.6 -m pip install --upgrade pip maturin
9191
- maturin build --no-sdist --release --strip --manylinux 2014 --interpreter python3.6
9292
- python3.6 -m pip install target/wheels/orjson*.whl

integration/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
flask;sys_platform!="win"
22
gunicorn;sys_platform!="win"
3-
httpx;sys_platform!="win"
3+
httpx==0.14.3;sys_platform!="win"

pydataclass

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ table = []
6565
for lib_name in LIBRARIES:
6666
if lib_name == "json":
6767
as_dict = timeit(
68-
lambda: json.dumps(objects_as_dict).encode("utf-8"), number=ITERATIONS,
68+
lambda: json.dumps(objects_as_dict).encode("utf-8"),
69+
number=ITERATIONS,
6970
)
7071
as_dataclass = timeit(
7172
lambda: json.dumps(objects_as_dataclass, default=default).encode("utf-8"),
@@ -84,12 +85,14 @@ for lib_name in LIBRARIES:
8485
)
8586
elif lib_name == "ujson":
8687
as_dict = timeit(
87-
lambda: ujson.dumps(objects_as_dict).encode("utf-8"), number=ITERATIONS,
88+
lambda: ujson.dumps(objects_as_dict).encode("utf-8"),
89+
number=ITERATIONS,
8890
)
8991
as_dataclass = None
9092
elif lib_name == "rapidjson":
9193
as_dict = timeit(
92-
lambda: rapidjson.dumps(objects_as_dict).encode("utf-8"), number=ITERATIONS,
94+
lambda: rapidjson.dumps(objects_as_dict).encode("utf-8"),
95+
number=ITERATIONS,
9396
)
9497
as_dataclass = timeit(
9598
lambda: rapidjson.dumps(objects_as_dataclass, default=default).encode(

pynonstr

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,25 @@ for lib_name in LIBRARIES:
5858
print(f"{lib_name}...")
5959
if lib_name == "json":
6060
time_as_str = timeit(
61-
lambda: json.dumps(data_as_str).encode("utf-8"), number=ITERATIONS,
61+
lambda: json.dumps(data_as_str).encode("utf-8"),
62+
number=ITERATIONS,
6263
)
6364
time_as_obj = timeit(
64-
lambda: json.dumps(data_as_obj).encode("utf-8"), number=ITERATIONS,
65+
lambda: json.dumps(data_as_obj).encode("utf-8"),
66+
number=ITERATIONS,
6567
)
6668
time_as_obj_sorted = (
6769
None # TypeError: '<' not supported between instances of 'str' and 'int'
6870
)
6971
correct = False
7072
elif lib_name == "simplejson":
7173
time_as_str = timeit(
72-
lambda: simplejson.dumps(data_as_str).encode("utf-8"), number=ITERATIONS,
74+
lambda: simplejson.dumps(data_as_str).encode("utf-8"),
75+
number=ITERATIONS,
7376
)
7477
time_as_obj = timeit(
75-
lambda: simplejson.dumps(data_as_obj).encode("utf-8"), number=ITERATIONS,
78+
lambda: simplejson.dumps(data_as_obj).encode("utf-8"),
79+
number=ITERATIONS,
7680
)
7781
time_as_obj_sorted = timeit(
7882
lambda: simplejson.dumps(data_as_obj, sort_keys=True).encode("utf-8"),
@@ -83,16 +87,19 @@ for lib_name in LIBRARIES:
8387
)
8488
elif lib_name == "ujson":
8589
time_as_str = timeit(
86-
lambda: ujson.dumps(data_as_str).encode("utf-8"), number=ITERATIONS,
90+
lambda: ujson.dumps(data_as_str).encode("utf-8"),
91+
number=ITERATIONS,
8792
)
8893
time_as_obj = timeit(
89-
lambda: ujson.dumps(data_as_obj).encode("utf-8"), number=ITERATIONS,
94+
lambda: ujson.dumps(data_as_obj).encode("utf-8"),
95+
number=ITERATIONS,
9096
)
9197
time_as_obj_sorted = None # segfault
9298
correct = False
9399
elif lib_name == "rapidjson":
94100
time_as_str = timeit(
95-
lambda: rapidjson.dumps(data_as_str).encode("utf-8"), number=ITERATIONS,
101+
lambda: rapidjson.dumps(data_as_str).encode("utf-8"),
102+
number=ITERATIONS,
96103
)
97104
time_as_obj = None
98105
time_as_obj_sorted = None

pynumpy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ for lib_name in LIBRARIES:
8383
mem = None
8484
correct = False
8585
else:
86-
total_latency = timeit(func, number=ITERATIONS,)
86+
total_latency = timeit(
87+
func,
88+
number=ITERATIONS,
89+
)
8790
latency = per_iter_latency(total_latency)
8891
time.sleep(1)
8992
mem = max(memory_usage((func,), interval=0.001, timeout=latency * 2))

pysort

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,35 @@ table = []
4949
for lib_name in LIBRARIES:
5050
if lib_name == "json":
5151
time_unsorted = timeit(
52-
lambda: json.dumps(data).encode("utf-8"), number=ITERATIONS,
52+
lambda: json.dumps(data).encode("utf-8"),
53+
number=ITERATIONS,
5354
)
5455
time_sorted = timeit(
55-
lambda: json.dumps(data, sort_keys=True).encode("utf-8"), number=ITERATIONS,
56+
lambda: json.dumps(data, sort_keys=True).encode("utf-8"),
57+
number=ITERATIONS,
5658
)
5759
elif lib_name == "simplejson":
5860
time_unsorted = timeit(
59-
lambda: simplejson.dumps(data).encode("utf-8"), number=ITERATIONS,
61+
lambda: simplejson.dumps(data).encode("utf-8"),
62+
number=ITERATIONS,
6063
)
6164
time_sorted = timeit(
6265
lambda: simplejson.dumps(data, sort_keys=True).encode("utf-8"),
6366
number=ITERATIONS,
6467
)
6568
elif lib_name == "ujson":
6669
time_unsorted = timeit(
67-
lambda: ujson.dumps(data).encode("utf-8"), number=ITERATIONS,
70+
lambda: ujson.dumps(data).encode("utf-8"),
71+
number=ITERATIONS,
6872
)
6973
time_sorted = timeit(
7074
lambda: ujson.dumps(data, sort_keys=True).encode("utf-8"),
7175
number=ITERATIONS,
7276
)
7377
elif lib_name == "rapidjson":
7478
time_unsorted = timeit(
75-
lambda: rapidjson.dumps(data).encode("utf-8"), number=ITERATIONS,
79+
lambda: rapidjson.dumps(data).encode("utf-8"),
80+
number=ITERATIONS,
7681
)
7782
time_sorted = timeit(
7883
lambda: rapidjson.dumps(data, sort_keys=True).encode("utf-8"),
@@ -81,7 +86,8 @@ for lib_name in LIBRARIES:
8186
elif lib_name == "orjson":
8287
time_unsorted = timeit(lambda: orjson.dumps(data), number=ITERATIONS)
8388
time_sorted = timeit(
84-
lambda: orjson.dumps(data, None, orjson.OPT_SORT_KEYS), number=ITERATIONS,
89+
lambda: orjson.dumps(data, None, orjson.OPT_SORT_KEYS),
90+
number=ITERATIONS,
8591
)
8692
orjson_time_sorted = per_iter_latency(time_sorted)
8793
else:

0 commit comments

Comments
 (0)