1
0
mirror of https://github.com/golang/go synced 2024-10-05 05:01:22 -06:00
go/src
Martin Möhrmann 43ed65f869 runtime: speed up growslice by avoiding divisions
Only compute the number of maximum allowed elements per slice once.
Special case newcap computation for slices with byte sized elements.

name              old time/op  new time/op  delta
GrowSliceBytes-2  61.1ns ± 1%  43.4ns ± 1%  -29.00%  (p=0.000 n=20+20)
GrowSliceInts-2   85.9ns ± 1%  75.7ns ± 1%  -11.80%  (p=0.000 n=20+20)

Change-Id: I5d9c0d5987cdd108ac29dc32e31912dcefa2324d
Reviewed-on: https://go-review.googlesource.com/20653
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-14 00:45:57 +00:00
..
archive all: single space after period. 2016-03-02 00:13:47 +00:00
bufio bufio: Reader.Peek returns partial results on ErrBufferFull 2016-03-04 03:51:22 +00:00
builtin
bytes bytes: correct comment about usage of bytes.Buffer by Printf 2016-03-10 15:54:08 +00:00
cmd cmd/compile, runtime: eliminate growslice_n 2016-03-13 23:34:31 +00:00
compress compress/flate: optimize huffman bit encoder 2016-03-11 17:40:52 +00:00
container all: single space after period. 2016-03-02 00:13:47 +00:00
crypto crypto/tls: implement dynamic record sizing 2016-03-12 00:47:13 +00:00
database/sql all: single space after period. 2016-03-02 00:13:47 +00:00
debug Rewrite leftover references to plan9.bell-labs.com to 9p.io. 2016-03-06 07:07:01 +00:00
encoding all: single space after period. 2016-03-02 00:13:47 +00:00
errors all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
expvar all: single space after period. 2016-03-02 00:13:47 +00:00
flag all: single space after period. 2016-03-02 00:13:47 +00:00
fmt fmt: refactor pointer formatting and improve tests 2016-03-09 20:59:50 +00:00
go testing: implement 'Unordered Output' in Examples. 2016-03-09 04:34:41 +00:00
hash hash/crc32: use slicing by 8 for Castagnoli and smaller sizes 2016-03-08 16:46:24 +00:00
html all: single space after period. 2016-03-02 00:13:47 +00:00
image Rewrite leftover references to plan9.bell-labs.com to 9p.io. 2016-03-06 07:07:01 +00:00
index/suffixarray
internal all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
io all: single space after period. 2016-03-02 00:13:47 +00:00
log all: single space after period. 2016-03-02 00:13:47 +00:00
math math: improve sqrt for ppc64le,ppc64 2016-03-10 15:01:21 +00:00
mime mime/multipart: don't call Read on io.Reader after an error is seen 2016-03-07 19:50:16 +00:00
net net/http: delete unused type readClose 2016-03-12 22:13:32 +00:00
os os/user: fix formatting of error group lookup message 2016-03-14 00:45:25 +00:00
path Rewrite leftover references to plan9.bell-labs.com to 9p.io. 2016-03-06 07:07:01 +00:00
reflect cmd/compile: compute number of arguments correctly 2016-03-12 01:23:25 +00:00
regexp all: single space after period. 2016-03-02 00:13:47 +00:00
runtime runtime: speed up growslice by avoiding divisions 2016-03-14 00:45:57 +00:00
sort all: single space after period. 2016-03-02 00:13:47 +00:00
strconv all: single space after period. 2016-03-02 00:13:47 +00:00
strings all: single space after period. 2016-03-02 00:13:47 +00:00
sync all: single space after period. 2016-03-02 00:13:47 +00:00
syscall syscall: add NO_LOCAL_POINTERS to syscall.exit in plan9_arm 2016-03-09 16:32:02 +00:00
testing testing: implement 'Unordered Output' in Examples. 2016-03-09 04:34:41 +00:00
text all: single space after period. 2016-03-02 00:13:47 +00:00
time all: single space after period. 2016-03-02 00:13:47 +00:00
unicode all: single space after period. 2016-03-02 00:13:47 +00:00
unsafe all: single space after period. 2016-03-02 00:13:47 +00:00
vendor
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash build: use go tool dist list 2016-02-26 03:58:58 +00:00
clean.bash
clean.bat
clean.rc
iostest.bash
make.bash
make.bat
Make.dist
make.rc
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc