Skip to content

Commit e04ea73

Browse files
committed
cargo update, build misc
1 parent ba8c701 commit e04ea73

File tree

7 files changed

+32
-30
lines changed

7 files changed

+32
-30
lines changed

Cargo.lock

Lines changed: 16 additions & 19 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
@@ -45,7 +45,7 @@ no-panic = [
4545
yyjson = []
4646

4747
[dependencies]
48-
ahash = { version = "^0.8.8", default_features = false, features = ["compile-time-rng"] }
48+
ahash = { version = "^0.8.9", default_features = false, features = ["compile-time-rng"] }
4949
arrayvec = { version = "0.7", default_features = false, features = ["std", "serde"] }
5050
associative-cache = { version = "2", default_features = false }
5151
beef = { version = "0.5", default_features = false, features = ["impl_serde"] }

script/develop

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
rm -f target/wheels/*
44

5-
export CC="clang"
6-
export CFLAGS="-O2 -fstrict-aliasing -emit-llvm -flto=full"
7-
export LDFLAGS="${CFLAGS} -fuse-ld=lld -Wl,--as-needed -Wl,-plugin-opt=also-emit-llvm"
8-
export RUSTFLAGS="-C linker=clang -C linker-plugin-lto -C lto=fat -C link-arg=-fuse-ld=lld -Z mir-opt-level=4 -Z virtual-function-elimination"
5+
export CC="${CC:-clang}"
6+
export LD="${LD:-lld}"
7+
8+
echo "CC: ${CC}, LD: ${LD}, LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
9+
export CFLAGS="-Os -fstrict-aliasing -emit-llvm -flto=full"
10+
export LDFLAGS="${CFLAGS} -fuse-ld=${LD} -Wl,--as-needed -Wl,-plugin-opt=also-emit-llvm"
11+
export RUSTFLAGS="-C linker=${CC} -C linker-plugin-lto -C lto=fat -C link-arg=-fuse-ld=${LD} -Z mir-opt-level=4 -Z virtual-function-elimination"
912

1013
maturin build "$@"
1114

script/graph

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def tab(obj):
8989
if not per_op_data:
9090
continue
9191

92+
clamp = 10 if operation == "serialization" else 5
93+
9294
json_baseline = {}
9395
for each in per_op_data:
9496
if each["group"] == "witter.json":
@@ -97,7 +99,9 @@ def tab(obj):
9799
json_baseline[each["group"]] = each["operations"]
98100

99101
for each in per_op_data:
100-
each["relative"] = each["operations"] / json_baseline[each["group"]]
102+
each["relative"] = min(
103+
each["operations"] / json_baseline[each["group"]], clamp
104+
)
101105

102106
p = pd.DataFrame.from_dict(per_op_data)
103107
p.groupby("group")
@@ -117,7 +121,6 @@ def tab(obj):
117121
pyplot.title(operation)
118122

119123
# ensure Y range
120-
clamp = 10 if operation == "serialization" else 5
121124
ylabels = set((min(v, clamp) for v in pyplot.gca().get_yticks()))
122125
pyplot.gca().set_yticks(list({1.0, 1.5}.union(ylabels)))
123126

src/deserialize/cache.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
22

3-
use associative_cache::replacement::RoundRobinReplacement;
4-
use associative_cache::*;
3+
use associative_cache::{AssociativeCache, Capacity1024, HashDirectMapped, RoundRobinReplacement};
54
use core::ffi::c_void;
65
use once_cell::unsync::OnceCell;
76
use std::hash::Hasher;

src/deserialize/error.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ impl<'a> DeserializeError<'a> {
5151
/// Return position of the error in the deserialized data
5252
#[cold]
5353
#[cfg(feature = "yyjson")]
54+
#[cfg_attr(feature = "optimize", optimize(size))]
5455
pub fn pos(&self) -> i64 {
5556
match self.data {
56-
Some(as_str) => bytecount::num_chars(&as_str.as_bytes()[0..self.pos as usize]) as i64,
57+
Some(as_str) => as_str[0..self.pos as usize].chars().count() as i64,
5758
None => 0,
5859
}
5960
}

src/serialize/per_type/numpy.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use chrono::{Datelike, NaiveDate, NaiveDateTime, Timelike};
1010
use core::ffi::{c_char, c_int, c_void};
1111
use pyo3_ffi::*;
1212
use serde::ser::{self, Serialize, SerializeSeq, Serializer};
13-
use std::convert::TryInto;
1413
use std::fmt;
1514

1615
#[repr(transparent)]

0 commit comments

Comments
 (0)