Closed burdges closed 7 years ago
I'm not sure about that... on my machine I see no difference. Have you compared generated assembly?
It likely depends upon your rust version, but one should broadly expect unsafe code to grow slower in future as the memory model work proceeds.
I've pushed an update to this branch for the current master and partially addressed #9
Oh https://github.com/debris/tiny-keccak/pull/11 is probably better.
Now closing since https://github.com/debris/tiny-keccak/pull/11 is merged.
Incidentally this improve performance slightly because the compiler avoids some check caused by the extra unsafe code:
Old : test bench_sha3_256_input_4096_bytes ... bench: 19,252 ns/iter (+/- 2,023) = 212 MB/s test keccakf_u64 ... bench: 591 ns/iter (+/- 234) = 42 MB/s
New: test bench_sha3_256_input_4096_bytes ... bench: 18,195 ns/iter (+/- 851) = 225 MB/s test keccakf_u64 ... bench: 574 ns/iter (+/- 19) = 43 MB/s