Rémy Oudompheng
ff416a3f19
cmd/gc: inline copy in frontend to call memmove directly.
...
A new node type OSPTR is added to refer to the data pointer of
strings and slices in a simple way during walk(). It will be
useful for future work on simplification of slice arithmetic.
benchmark old ns/op new ns/op delta
BenchmarkCopy1Byte 9 8 -13.98%
BenchmarkCopy2Byte 14 8 -40.49%
BenchmarkCopy4Byte 13 8 -35.04%
BenchmarkCopy8Byte 13 8 -37.10%
BenchmarkCopy12Byte 14 12 -15.38%
BenchmarkCopy16Byte 14 12 -17.24%
BenchmarkCopy32Byte 19 14 -27.32%
BenchmarkCopy128Byte 31 26 -15.29%
BenchmarkCopy1024Byte 100 92 -7.50%
BenchmarkCopy1String 10 7 -28.99%
BenchmarkCopy2String 10 7 -28.06%
BenchmarkCopy4String 10 8 -22.69%
BenchmarkCopy8String 10 8 -23.30%
BenchmarkCopy12String 11 11 -5.88%
BenchmarkCopy16String 11 11 -5.08%
BenchmarkCopy32String 15 14 -6.58%
BenchmarkCopy128String 28 25 -10.60%
BenchmarkCopy1024String 95 95 +0.53%
R=golang-dev, bradfitz, cshapiro, dave, daniel.morsing, rsc, khr, khr
CC=golang-dev
https://golang.org/cl/9101048
2013-09-12 00:15:28 +02:00
Dave Cheney
8ce8adbe7a
runtime: tune append crossover on amd64 and 386
...
Fixes #4963 .
Sets the append crossover to 0 on intel platforms.
Results for linux/amd64 Core i5 SNB
benchmark old ns/op new ns/op delta
BenchmarkAppend 102 104 +1.96%
BenchmarkAppend1Byte 10 11 +0.92%
BenchmarkAppend4Bytes 15 11 -28.10%
BenchmarkAppend7Bytes 17 12 -32.58%
BenchmarkAppend8Bytes 18 12 -36.17%
BenchmarkAppend15Bytes 24 11 -55.02%
BenchmarkAppend16Bytes 25 11 -56.03%
BenchmarkAppend32Bytes 11 12 +4.31%
BenchmarkAppendStr1Byte 8 9 +13.99%
BenchmarkAppendStr4Bytes 11 9 -17.52%
BenchmarkAppendStr8Bytes 14 9 -35.70%
BenchmarkAppendStr16Bytes 21 9 -55.19%
BenchmarkAppendStr32Bytes 10 10 -5.66%
BenchmarkAppendSpecialCase 49 52 +7.96%
Results for linux/386 Atom(TM) CPU 330 @ 1.60GHz
benchmark old ns/op new ns/op delta
BenchmarkAppend 219 218 -0.46%
BenchmarkAppend1Byte 75 72 -3.44%
BenchmarkAppend4Bytes 92 73 -19.87%
BenchmarkAppend7Bytes 108 74 -31.20%
BenchmarkAppend8Bytes 116 74 -35.95%
BenchmarkAppend15Bytes 162 77 -52.22%
BenchmarkAppend16Bytes 169 77 -54.20%
BenchmarkAppend32Bytes 88 86 -2.38%
BenchmarkAppendStr1Byte 57 59 +3.32%
BenchmarkAppendStr4Bytes 72 59 -17.40%
BenchmarkAppendStr8Bytes 92 60 -34.70%
BenchmarkAppendStr16Bytes 141 63 -54.89%
BenchmarkAppendStr32Bytes 75 73 -2.64%
BenchmarkAppendSpecialCase 270 270 +0.00%
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12440044
2013-08-06 07:51:37 +10:00
Rémy Oudompheng
1f74aa21d5
runtime: benchmark for appending N bytes should not append N² bytes.
...
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7420051
2013-03-02 21:11:05 +01:00
Rob Pike
f235d5d8d7
runtime: special-case append([]byte, string) for small strings
...
Also make the crossover point an architecture-dependent constant,
although it's the same everywhere for now.
BenchmarkAppendStr1Byte 416 145 -65.14%
BenchmarkAppendStr4Bytes 743 217 -70.79%
BenchmarkAppendStr8Bytes 421 270 -35.87%
BenchmarkAppendStr16Bytes 415 403 -2.89%
BenchmarkAppendStr32Bytes 415 391 -5.78%
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7459044
2013-03-01 16:41:39 -08:00
Rob Pike
8cfed59941
runtime: special-case small byte appends.
...
Update #3679 .
BenchmarkAppend1Byte 484 199 -58.88%
BenchmarkAppend4Bytes 829 286 -65.50%
BenchmarkAppend8Bytes 484 365 -24.59%
BenchmarkAppend16Bytes 484 498 +2.89%
BenchmarkAppend32Bytes 486 484 -0.41%
R=iant, dave, rsc
CC=golang-dev
https://golang.org/cl/7443047
2013-03-01 14:31:26 -08:00
Russ Cox
29125be5c7
runtime: make TestSideEffectOrder work twice
...
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4714045
2011-07-14 23:43:03 -04:00
Luuk van Dijk
d6b2925923
gc: inline append when len<cap
...
issue 1604
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4313062
2011-05-11 16:35:11 +02:00