Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace serde_json with simd_json where supported #3174

Draft
wants to merge 1 commit into
base: latest
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 182 additions & 2 deletions Cargo.lock

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

18 changes: 9 additions & 9 deletions flake.lock

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

5 changes: 0 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
export MACOSX_DEPLOYMENT_TARGET=10.14
'';

# Work around https://github.com/NixOS/nixpkgs/issues/166205.
env = lib.optionalAttrs stdenv.cc.isClang {
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
};

buildInputs = lib.optionals stdenv.isDarwin [ pkgs.libiconv pkgs.darwin.apple_sdk.frameworks.Security ];

nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook bindgenHook ];
Expand Down
3 changes: 2 additions & 1 deletion src/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ rayon = { version = "1.10.0", optional = true }
rkyv = { version = "0.7.44", optional = true }
roaring = "0.10.4"
roots = "0.0.8"
simd-json = "0.13.10"
serde = { version = "1.0.202", features = ["derive"] }
serde_json = "1.0.117"
statrs = "0.16.0"
streaming-stats = "0.2.3"
thiserror = "1.0"
Expand Down Expand Up @@ -98,6 +98,7 @@ skip_feature_sets = [
js-sys = "0.3.68"
web-sys = { version = "0.3.69", features = ["console", "File", "FileReaderSync"] }
wasm-bindgen = { version = "0.2.89", features = ["serde-serialize"] }
serde_json = { version = "1.0.117" }

[target.'cfg(all(target_arch = "wasm32"))'.dependencies]
chrono = { version = "0.4.32", features = ["wasmbind"] }
Expand Down
4 changes: 2 additions & 2 deletions src/core/benches/minhash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn intersection(c: &mut Criterion) {
filename.push("../../tests/test-data/gather-abund/genome-s10.fa.gz.sig");
let file = File::open(filename).unwrap();
let reader = BufReader::new(file);
let mut sigs: Vec<Signature> = serde_json::from_reader(reader).expect("Loading error");
let mut sigs: Vec<Signature> = simd_json::from_reader(reader).expect("Loading error");
let mh = if let Sketch::MinHash(mh) = &sigs.swap_remove(0).sketches()[0] {
mh.clone()
} else {
Expand All @@ -27,7 +27,7 @@ fn intersection(c: &mut Criterion) {
filename.push("../../tests/test-data/gather-abund/genome-s11.fa.gz.sig");
let file = File::open(filename).unwrap();
let reader = BufReader::new(file);
let mut sigs: Vec<Signature> = serde_json::from_reader(reader).expect("Loading error");
let mut sigs: Vec<Signature> = simd_json::from_reader(reader).expect("Loading error");
let mh2 = if let Sketch::MinHash(mh) = &sigs.swap_remove(0).sketches()[0] {
mh.clone()
} else {
Expand Down
Loading
Loading