]> Cypherpunks repositories - gostls13.git/commit
runtime: special-case append([]byte, string) for small strings
authorRob Pike <r@golang.org>
Sat, 2 Mar 2013 00:41:39 +0000 (16:41 -0800)
committerRob Pike <r@golang.org>
Sat, 2 Mar 2013 00:41:39 +0000 (16:41 -0800)
commitf235d5d8d702778c7d16e573c855519a8238951c
treeacb48718c05133a1051313f8d46b136cce77ce74
parent8cfed59941655f6a77af065f0196dff6450f52a7
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
src/pkg/runtime/append_test.go
src/pkg/runtime/arch_386.h
src/pkg/runtime/arch_amd64.h
src/pkg/runtime/arch_arm.h
src/pkg/runtime/slice.c