summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorUlrik Sverdrup <bluss@users.noreply.github.com>2016-01-26 21:31:33 +0100
committerUlrik Sverdrup <bluss@users.noreply.github.com>2016-01-27 00:04:03 +0100
commitd3174ce75112a52082580065b041f8f4330fefa5 (patch)
tree8d1b67b2f22503d4f5371de304bd1ca6bd5954e0 /src/libstd/sys/unix/stack_overflow.rs
parent46dcffd05b46e62c27629f4231fc794e94e614a8 (diff)
downloadrust-d3174ce75112a52082580065b041f8f4330fefa5.tar.gz
rust-d3174ce75112a52082580065b041f8f4330fefa5.zip
collections: Hash VecDeque in its slice parts
Use .as_slices() for a more efficient code path in VecDeque's Hash impl.

This still hashes the elements in the same order.

Before/after timing of VecDeque hashing 1024 elements of u8 and
u64 shows that the vecdeque now can match the Vec
(test_hashing_vec_of_u64 is the Vec run).

before

test test_hashing_u64        ... bench:  14,031 ns/iter (+/- 236) = 583 MB/s
test test_hashing_u8         ... bench:   7,887 ns/iter (+/- 65) = 129 MB/s
test test_hashing_vec_of_u64 ... bench:   6,578 ns/iter (+/- 76) = 1245 MB/s

after

running 5 tests
test test_hashing_u64        ... bench:   6,495 ns/iter (+/- 52) = 1261 MB/s
test test_hashing_u8         ... bench:     851 ns/iter (+/- 16) = 1203 MB/s
test test_hashing_vec_of_u64 ... bench:   6,499 ns/iter (+/- 59) = 1260 MB/s
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions