forked from debris/tiny-keccak
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Not unrolling the outer loop seems to speed up hashing quite significally: Original (unrolled): ``` running 3 tests test bench_keccak_256_with_empty_input ... bench: 557 ns/iter (+/- 46) test bench_keccak_256_with_large_input ... bench: 17,288 ns/iter (+/- 1,871) = 236 MB/s test bench_keccak_256_with_typical_input ... bench: 577 ns/iter (+/- 28) = 88 MB/s ``` This branch (not unrolled): ``` running 3 tests test bench_keccak_256_with_empty_input ... bench: 487 ns/iter (+/- 25) test bench_keccak_256_with_large_input ... bench: 14,645 ns/iter (+/- 675) = 279 MB/s test bench_keccak_256_with_typical_input ... bench: 495 ns/iter (+/- 32) = 103 MB/s ``` "Inspired" by https://github.com/RustCrypto/sponges/blob/master/keccak/src/lib.rs#L138 Running benchmarks from the `keccak-hash` crate so we can compare to the numbers [here](paritytech/keccak-hash#1).
- Loading branch information
Showing
2 changed files
with
49 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
target | ||
Cargo.lock | ||
*.swp | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters