about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorStjepan Glavina <stjepang@gmail.com>2017-03-25 00:27:47 +0100
committerStjepan Glavina <stjepang@gmail.com>2017-03-25 00:32:15 +0100
commit2c816f7fb6772fe0b77af04da9355aab6c2d3fb2 (patch)
treeb546db6282b3a8184714b97dd92a0e9647b6e280 /src/libstd/sync
parentc6df67afca788453a3c494899fbf5295992bcfba (diff)
downloadrust-2c816f7fb6772fe0b77af04da9355aab6c2d3fb2.tar.gz
rust-2c816f7fb6772fe0b77af04da9355aab6c2d3fb2.zip
Optimize insertion sort
This change slightly changes the main iteration loop so that LLVM can
optimize it more efficiently.

Benchmark:

name                                   before ns/iter   after ns/iter    diff ns/iter   diff %
slice::sort_unstable_small_ascending   39 (2051 MB/s)   38 (2105 MB/s)             -1   -2.56%
slice::sort_unstable_small_big_random  579 (2210 MB/s)  575 (2226 MB/s)            -4   -0.69%
slice::sort_unstable_small_descending  80 (1000 MB/s)   70 (1142 MB/s)            -10  -12.50%
slice::sort_unstable_small_random      396 (202 MB/s)   386                       -10   -2.53%
Diffstat (limited to 'src/libstd/sync')
0 files changed, 0 insertions, 0 deletions