]> git.lizzy.rs Git - rust.git/commit
rollup merge of #21886: dotdash/fast_slice_iter
authorAlex Crichton <alex@alexcrichton.com>
Wed, 18 Feb 2015 22:31:21 +0000 (14:31 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 18 Feb 2015 22:31:21 +0000 (14:31 -0800)
commitfa30c4f147865bea8a8b4c652827330f7f011ebd
tree28ada1feea39cb5f455b30ab44d0438600020909
parentdfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5
parent7412d1b2eff1c77241c54fa39508e7049d71ec7e
rollup merge of #21886: dotdash/fast_slice_iter

The data pointer used in the slice is never null, using assume() to tell
LLVM about it gets rid of various unneeded null checks when iterating
over the slice.

Since the snapshot compiler is still using an older LLVM version, omit
the call in stage0, because compile times explode otherwise.

Benchmarks from #18193
````
running 5 tests
test _range    ... bench:     33329 ns/iter (+/- 417)
test assembly  ... bench:     33299 ns/iter (+/- 58)
test enumerate ... bench:     33318 ns/iter (+/- 83)
test iter      ... bench:     33311 ns/iter (+/- 130)
test position  ... bench:     33300 ns/iter (+/- 47)

test result: ok. 0 passed; 0 failed; 0 ignored; 5 measured
````

Fixes #18193