mozilla/rust — pull request #13522 by seanmonstar (2014-04-14 23:18:13+00:00)
Title: optimzed SipHash implementation

work started from @gereeter's PR: https://github.com/mozilla/rust/pull/13114
but adjusted bits

```
before
test hash::sip::tests::bench_u64 ... bench: 34 ns/iter (+/- 0)
test hash::sip::tests::bench_str_under_8_bytes ... bench: 37 ns/iter (+/- 1)
test hash::sip::tests::bench_str_of_8_bytes ... bench: 43 ns/iter (+/- 1)
test hash::sip::tests::bench_str_over_8_bytes ... bench: 50 ns/iter (+/- 1)
test hash::sip::tests::bench_long_str ... bench: 613 ns/iter (+/- 14)
test hash::sip::tests::bench_compound_1 ... bench: 114 ns/iter (+/- 11)

after
test hash::sip::tests::bench_u64 ... bench: 25 ns/iter (+/- 0)
test hash::sip::tests::bench_str_under_8_bytes ... bench: 31 ns/iter (+/- 0)
test hash::sip::tests::bench_str_of_8_bytes ... bench: 36 ns/iter (+/- 0)
test hash::sip::tests::bench_str_over_8_bytes ... bench: 40 ns/iter (+/- 0)
test hash::sip::tests::bench_long_str ... bench: 600 ns/iter (+/- 14)
test hash::sip::tests::bench_compound_1 ... bench: 64 ns/iter (+/- 6)
```

Notably it seems smaller keys will hash faster. A long string doesn't see much gains, but compound cuts in half (once compound used a `int` and `u64`).