Skip to content

Commit

Permalink
cargo update, build misc
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Feb 23, 2024
1 parent ba8c701 commit e04ea73
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 30 deletions.
35 changes: 16 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ no-panic = [
yyjson = []

[dependencies]
ahash = { version = "^0.8.8", default_features = false, features = ["compile-time-rng"] }
ahash = { version = "^0.8.9", default_features = false, features = ["compile-time-rng"] }
arrayvec = { version = "0.7", default_features = false, features = ["std", "serde"] }
associative-cache = { version = "2", default_features = false }
beef = { version = "0.5", default_features = false, features = ["impl_serde"] }
Expand Down
11 changes: 7 additions & 4 deletions script/develop
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

rm -f target/wheels/*

export CC="clang"
export CFLAGS="-O2 -fstrict-aliasing -emit-llvm -flto=full"
export LDFLAGS="${CFLAGS} -fuse-ld=lld -Wl,--as-needed -Wl,-plugin-opt=also-emit-llvm"
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"
export CC="${CC:-clang}"
export LD="${LD:-lld}"

echo "CC: ${CC}, LD: ${LD}, LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
export CFLAGS="-Os -fstrict-aliasing -emit-llvm -flto=full"
export LDFLAGS="${CFLAGS} -fuse-ld=${LD} -Wl,--as-needed -Wl,-plugin-opt=also-emit-llvm"
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"

maturin build "$@"

Expand Down
7 changes: 5 additions & 2 deletions script/graph
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def tab(obj):
if not per_op_data:
continue

clamp = 10 if operation == "serialization" else 5

json_baseline = {}
for each in per_op_data:
if each["group"] == "witter.json":
Expand All @@ -97,7 +99,9 @@ def tab(obj):
json_baseline[each["group"]] = each["operations"]

for each in per_op_data:
each["relative"] = each["operations"] / json_baseline[each["group"]]
each["relative"] = min(
each["operations"] / json_baseline[each["group"]], clamp
)

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

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

Expand Down
3 changes: 1 addition & 2 deletions src/deserialize/cache.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: (Apache-2.0 OR MIT)

use associative_cache::replacement::RoundRobinReplacement;
use associative_cache::*;
use associative_cache::{AssociativeCache, Capacity1024, HashDirectMapped, RoundRobinReplacement};
use core::ffi::c_void;
use once_cell::unsync::OnceCell;
use std::hash::Hasher;
Expand Down
3 changes: 2 additions & 1 deletion src/deserialize/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ impl<'a> DeserializeError<'a> {
/// Return position of the error in the deserialized data
#[cold]
#[cfg(feature = "yyjson")]
#[cfg_attr(feature = "optimize", optimize(size))]
pub fn pos(&self) -> i64 {
match self.data {
Some(as_str) => bytecount::num_chars(&as_str.as_bytes()[0..self.pos as usize]) as i64,
Some(as_str) => as_str[0..self.pos as usize].chars().count() as i64,
None => 0,
}
}
Expand Down
1 change: 0 additions & 1 deletion src/serialize/per_type/numpy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use chrono::{Datelike, NaiveDate, NaiveDateTime, Timelike};
use core::ffi::{c_char, c_int, c_void};
use pyo3_ffi::*;
use serde::ser::{self, Serialize, SerializeSeq, Serializer};
use std::convert::TryInto;
use std::fmt;

#[repr(transparent)]
Expand Down

0 comments on commit e04ea73

Please sign in to comment.