1
0
mirror of https://github.com/golang/go synced 2024-11-05 15:36:09 -07:00
go/src
Martin Möhrmann d295174030 runtime: speed up non-ASCII rune decoding
Copies utf8 constants and EncodeRune implementation from unicode/utf8.

Adds a new decoderune implementation that is used by the compiler
in code generated for ranging over strings. It does not handle
ASCII runes since these are handled directly before calls to decoderune.

The DecodeRuneInString implementation from unicode/utf8 is not used
since it uses a lookup table that would increase the use of cpu caches.

Adds more tests that check decoding of valid and invalid utf8 sequences.

name                              old time/op  new time/op  delta
RuneIterate/range2/ASCII-4        7.45ns ± 2%  7.45ns ± 1%     ~     (p=0.634 n=16+16)
RuneIterate/range2/Japanese-4     53.5ns ± 1%  49.2ns ± 2%   -8.03%  (p=0.000 n=20+20)
RuneIterate/range2/MixedLength-4  46.3ns ± 1%  41.0ns ± 2%  -11.57%  (p=0.000 n=20+20)

new:
"".decoderune t=1 size=423 args=0x28 locals=0x0
old:
"".charntorune t=1 size=666 args=0x28 locals=0x0

Change-Id: I1df1fdb385bb9ea5e5e71b8818ea2bf5ce62de52
Reviewed-on: https://go-review.googlesource.com/28490
Run-TryBot: Martin Möhrmann <martisch@uos.de>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-17 11:25:22 +00:00
..
archive archive/tar: reduce allocations in formatOctal 2016-10-12 21:27:51 +00:00
bufio bufio: remove redundant Writer.flush method 2016-10-01 15:46:15 +00:00
builtin builtin: clarify that make(map[K]V, n) allocates space for n elements 2016-09-10 12:57:37 +00:00
bytes bytes: encode size of rune read by ReadRune into lastRead to speed up UnreadRune 2016-10-17 06:00:35 +00:00
cmd runtime: speed up non-ASCII rune decoding 2016-10-17 11:25:22 +00:00
compress compress/flate: use correct table for size estimation 2016-10-17 09:00:41 +00:00
container container/list: silence vet warnings 2016-08-16 14:35:37 +00:00
context context: make DeadlineExceeded implement net.Error 2016-10-05 15:53:04 +00:00
crypto crypto/x509: implement SystemCertPool on Windows 2016-10-17 08:29:16 +00:00
database/sql database/sql: add option to use named parameter in query arguments 2016-10-17 07:56:35 +00:00
debug debug/elf: add sparc64 relocations 2016-10-11 21:52:37 +00:00
encoding encoding/xml: split attribute marshaling into its own method 2016-10-13 17:47:44 +00:00
errors
expvar expvar: add Value methods 2016-10-13 21:39:03 +00:00
flag flag: use strconv instead of fmt in values' String funcs 2016-09-10 10:29:44 +00:00
fmt fmt: document and adjust Scanf space handling to eliminate a few paradoxes 2016-10-07 03:46:50 +00:00
go go/internal/gcimporter: set Pos attribute of decoded types.Objects 2016-10-13 19:31:09 +00:00
hash hash/crc32: cleanup code and improve tests 2016-08-31 15:17:57 +00:00
html html/template: fix Clone so that t.Lookup(t.Name()) yields t 2016-10-17 00:35:20 +00:00
image image/gif: check handling of truncated GIF files 2016-10-05 04:28:45 +00:00
index/suffixarray index/suffixarray: add Lookup example 2016-08-21 01:10:22 +00:00
internal os: use FindFirstFile when GetFileAttributesEx fails in Stat 2016-10-14 03:58:15 +00:00
io io: simplified a small part of copyBuffer 2016-10-09 22:50:12 +00:00
log log/syslog: document that Dial uses net.Dial parameters, add example 2016-08-19 01:01:47 +00:00
math math/big: move ProbablyPrime into its own source file 2016-10-11 16:16:17 +00:00
mime net/http: multipart ReadForm close file after copy 2016-10-05 16:35:03 +00:00
net net/http: support multiple identical Content-Length headers 2016-10-17 09:02:42 +00:00
os os: use FindFirstFile when GetFileAttributesEx fails in Stat 2016-10-14 03:58:15 +00:00
path path/filepath: simplify TestToNorm 2016-10-16 09:21:57 +00:00
plugin plugin: darwin support 2016-09-23 02:16:42 +00:00
reflect reflect: ignore struct tags when converting structs 2016-10-04 17:15:59 +00:00
regexp regexp: remove dead code 2016-10-04 14:49:35 +00:00
runtime runtime: speed up non-ASCII rune decoding 2016-10-17 11:25:22 +00:00
sort sort: fix a slice benchmark not using the stable variant, add another 2016-10-05 14:43:23 +00:00
strconv strconv: fix function name in errors for Atoi 2016-09-04 00:17:58 +00:00
strings strings: use Index in Count 2016-10-15 16:39:31 +00:00
sync cmd/compile: intrinsify sync/atomic for amd64 2016-08-30 15:23:23 +00:00
syscall syscall, net: make deadline changes affect blocked read/write calls on nacl 2016-10-17 05:53:00 +00:00
testing testing: mention in docs for Logf that a final newline is added if needed 2016-10-16 22:29:55 +00:00
text text/template: improve lexer performance in finding left delimiters. 2016-09-13 12:51:13 +00:00
time time: document that calendrical calculations are with no leap seconds 2016-10-06 19:43:14 +00:00
unicode runtime: speed up non-ASCII rune decoding 2016-10-17 11:25:22 +00:00
unsafe unsafe: document use of &^ to round/align pointers 2016-08-18 16:45:17 +00:00
vendor/golang_org/x vendor/golang_org/x/crypto/curve25519: new package 2016-10-12 17:03:55 +00:00
all.bash
all.bat
all.rc
androidtest.bash androidtest.bash: use go list to get pkg dir 2016-08-29 15:24:39 +00:00
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash cmd/dist, cmd/go: add environment variable override for pkg-config 2016-10-03 18:08:01 +00:00
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc