about summary refs log tree commit diff
path: root/src/test/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@google.com>2017-10-16 14:05:16 +0200
committerAlkis Evlogimenos <alkis@evlogimenos.com>2017-11-11 16:00:26 +0100
commit2ca111b6b91c578c8a2b8e610471e582b6cf2c6b (patch)
tree88afd56b58e022a2d3e92ebd98e8f2833f74ab87 /src/test/debuginfo/enum-thinlto.rs
parentba4e8d7db311b8a43a446cc20c30e4680b94c5d3 (diff)
downloadrust-2ca111b6b91c578c8a2b8e610471e582b6cf2c6b.tar.gz
rust-2ca111b6b91c578c8a2b8e610471e582b6cf2c6b.zip
Improve the performance of binary_search by reducing the number of
unpredictable conditional branches in the loop. In addition improve the
benchmarks to test performance in l1, l2 and l3 caches on sorted arrays
with or without dups.

Before:

```
test slice::binary_search_l1                               ... bench:  48 ns/iter (+/- 1)
test slice::binary_search_l2                               ... bench:  63 ns/iter (+/- 0)
test slice::binary_search_l3                               ... bench: 152 ns/iter (+/- 12)
test slice::binary_search_l1_with_dups                     ... bench:  36 ns/iter (+/- 0)
test slice::binary_search_l2_with_dups                     ... bench:  64 ns/iter (+/- 1)
test slice::binary_search_l3_with_dups                     ... bench: 153 ns/iter (+/- 6)
```

After:

```
test slice::binary_search_l1                               ... bench:  15 ns/iter (+/- 0)
test slice::binary_search_l2                               ... bench:  23 ns/iter (+/- 0)
test slice::binary_search_l3                               ... bench: 100 ns/iter (+/- 17)
test slice::binary_search_l1_with_dups                     ... bench:  15 ns/iter (+/- 0)
test slice::binary_search_l2_with_dups                     ... bench:  23 ns/iter (+/- 0)
test slice::binary_search_l3_with_dups                     ... bench:  98 ns/iter (+/- 14)
```
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions