about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2015-09-16 15:27:14 +0200
committerAndrea Canciani <ranma42@gmail.com>2015-09-16 15:27:14 +0200
commit369a9dc302582145e37cf335c454fb6bd74906c6 (patch)
treec4466c1ef9744288a7c9e40207c07aa68c87163f /src/rustllvm/RustWrapper.cpp
parentbf9254a75e06f61ecd837e2f90ed0afc22ffdede (diff)
downloadrust-369a9dc302582145e37cf335c454fb6bd74906c6.tar.gz
rust-369a9dc302582145e37cf335c454fb6bd74906c6.zip
Remove boundary checks in slice comparison operators
In order to get rid of all range checks, the compiler needs to
explicitly see that the slices it iterates over are as long as the
loop variable upper bound.

This further improves the performance of slice comparison:

```
test u8_cmp          ... bench:       4,761 ns/iter (+/- 1,203)
test u8_lt           ... bench:       4,579 ns/iter (+/- 649)
test u8_partial_cmp  ... bench:       4,768 ns/iter (+/- 761)
test u16_cmp         ... bench:       4,607 ns/iter (+/- 580)
test u16_lt          ... bench:       4,681 ns/iter (+/- 567)
test u16_partial_cmp ... bench:       4,607 ns/iter (+/- 967)
test u32_cmp         ... bench:       4,448 ns/iter (+/- 891)
test u32_lt          ... bench:       4,546 ns/iter (+/- 992)
test u32_partial_cmp ... bench:       4,415 ns/iter (+/- 646)
test u64_cmp         ... bench:       4,380 ns/iter (+/- 1,184)
test u64_lt          ... bench:       5,684 ns/iter (+/- 602)
test u64_partial_cmp ... bench:       4,663 ns/iter (+/- 1,158)
```
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions