Skip to content

Commit

Permalink
Replace serde_json with simd_json where supported
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed May 25, 2024
1 parent c192268 commit 2d7b3e9
Show file tree
Hide file tree
Showing 11 changed files with 247 additions and 71 deletions.
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

0 comments on commit 2d7b3e9

Please sign in to comment.