One thing I like to test is that, if I hack simd_degree to be higher
than MAX_SIMD_DEGREE, assertions fire. This requires a test case long
enough to exceed that number of chunks.
Because compress_subtree_to_parent_node effectively cuts its input in
half, we can give it an input that's twice as big, without violating the
CV stack invariant.
Using mmap is not always the best option. For instance, if the file is
truncated while being read, b3sum will receive a SIGBUS and abort.
Follow ripgrep's lead and add a --no-mmap option to disable mmap. This
can also help benchmark the mmap versus the read path, and help debug
performance issues potentially caused by mmap access patterns (like
issue #32).
Changes since 0.1.1:
- b3sum no longer mmaps files smaller than 16 KiB. This improves
performance for hashing many small files. Contributed by @xzfc.
- b3sum now supports --raw output. Contributed by @phayes.
Changes since 0.1.0:
- Optimizations contributed by @cesarb.
- Fix the build on x86_64-pc-windows-gnu when c_avx512 is enabled.
- Add an explicit error message for compilers that don't support c_avx512.
If AVX-512 is enabled, and the local C compiler doesn't support it, the
build is going to fail. However, if we check for this explicitly, we can
give a better error message.
Fixes https://github.com/BLAKE3-team/BLAKE3/issues/6.
For the Read and Write traits, this also allows the compiler to see that
the return value is always Ok, allowing it to remove the Err case from
the caller as dead code.
The generic constant_time_eq has several branches on the slice length,
which are not necessary when the slice length is known. However, the
optimizer is not allowed to look into the core of constant_time_eq, so
these branches cannot be elided.
Use instead a fixed-size variant of constant_time_eq, which has no
branches since the length is known.
I must've written the comment one way, and then changed the context
string later, without realizing that I'd copied it. Apologies to
everyone whose time I wasted with this.
Fixes https://github.com/BLAKE3-team/BLAKE3/issues/15.