Skip to content

Commit

Permalink
tests: opt-level=3
Browse files Browse the repository at this point in the history
  • Loading branch information
Nugine committed Nov 15, 2022
1 parent 508bffc commit 48bd619
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
members = ["crates/*", "benches", "analyze"]
resolver = "2"

[profile.test]
opt-level = 3

[profile.bench]
lto = "fat"
codegen-units = 1

1 comment on commit 48bd619

@Nugine
Copy link
Owner Author

@Nugine Nugine commented on 48bd619 Nov 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work around nodejs bug


cd crates/hex-simd
just wasm-test

Nodejs will allocate too much memory until being killed.

This function (when unoptimized) is so complex that it triggers nodejs bug

#[inline(always)]
pub unsafe fn decode_simd<S: SIMD256>(s: S, src: *const u8, len: usize, dst: *mut u8) -> Result<(), Error> {
if is_isa_type!(S, SSE2) {
return decode_simd_sse2(SSE2::new(), src, len, dst);
}
if is_subtype!(S, AVX2) {
return decode_simd_v256(s, src, len, dst);
}
decode_simd_v128(s, src, len, dst)
}

Please sign in to comment.