diff options
| author | Martin Möhrmann <martisch@uos.de> | 2014-12-23 20:44:10 +0100 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2014-12-23 23:21:04 +0000 |
| commit | 76cc881ef09e0358dd72106860d5da5e4c517f2a (patch) | |
| tree | 7b51e067d48d1738b6509faff1e8df1c97f33a28 /src/database/sql | |
| parent | 131758183f7dc2610af489da3a7fcc4d30c6bc48 (diff) | |
| download | go-76cc881ef09e0358dd72106860d5da5e4c517f2a.tar.xz | |
sort: simplify rotate and reduce calls to it
Move the checks for empty rotate changes
from the beginning of rotate to the callers.
Remove additional variable p used instead of existing m with same value.
Remove special casing of equal ranges (i==j) to exit early as no
work is saved vs checking (i!=j) and making a single
swapRange call if this is false.
benchmark old ns/op new ns/op delta
BenchmarkStableString1K 417195 425218 +1.92%
BenchmarkStableInt1K 126661 124498 -1.71%
BenchmarkStableInt64K 10365014 10417438 +0.51%
BenchmarkStable1e2 132151 130648 -1.14%
BenchmarkStable1e4 42027428 40812649 -2.89%
BenchmarkStable1e6 8524772364 8430192391 -1.11%
Change-Id: Ia7642e9d31408496970c700f5843d53cc3ebe817
Reviewed-on: https://go-review.googlesource.com/2100
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/database/sql')
0 files changed, 0 insertions, 0 deletions
