go/src
Marcel van Lohuizen 3d198bd7be unicode/utf8: added benchmarks
Cover some functions that weren't benched before and add InString
variants if the underlying implementation is different.

Note: compare (Valid|RuneCount)InString* to their (Valid|RuneCount)*
counterparts. It shows, somewhat unexpectedly, that ranging over
a string is *much* slower than using calls to DecodeRune.

Results:
In order to avoid a discrepancy in measuring the performance
of core we could leave the names of the string-based measurements
unchanged and suffix the added alternatives with Bytes.

Compared to old:
BenchmarkRuneCountTenASCIIChars-8        44.3          12.4          -72.01%
BenchmarkRuneCountTenJapaneseChars-8     167           67.1          -59.82%
BenchmarkEncodeASCIIRune-8               3.37          3.44          +2.08%
BenchmarkEncodeJapaneseRune-8            7.19          7.24          +0.70%
BenchmarkDecodeASCIIRune-8               5.41          5.53          +2.22%
BenchmarkDecodeJapaneseRune-8            8.17          8.41          +2.94%

All benchmarks:
BenchmarkRuneCountTenASCIIChars-8           	100000000	        12.4 ns/op
BenchmarkRuneCountTenJapaneseChars-8        	20000000	        67.1 ns/op
BenchmarkRuneCountInStringTenASCIIChars-8   	30000000	        44.5 ns/op
BenchmarkRuneCountInStringTenJapaneseChars-8	10000000	       165 ns/op
BenchmarkValidTenASCIIChars-8               	100000000	        12.5 ns/op
BenchmarkValidTenJapaneseChars-8            	20000000	        71.1 ns/op
BenchmarkValidStringTenASCIIChars-8         	30000000	        50.0 ns/op
BenchmarkValidStringTenJapaneseChars-8      	10000000	       161 ns/op
BenchmarkEncodeASCIIRune-8                  	500000000	         3.44 ns/op
BenchmarkEncodeJapaneseRune-8               	200000000	         7.24 ns/op
BenchmarkDecodeASCIIRune-8                  	300000000	         5.53 ns/op
BenchmarkDecodeJapaneseRune-8               	200000000	         8.41 ns/op
BenchmarkFullASCIIRune-8                    	500000000	         3.91 ns/op
BenchmarkFullJapaneseRune-8                 	300000000	         4.22 ns/op

Change-Id: I674d2ee4917b975a37717bbfa1082cc84dcd275e
Reviewed-on: https://go-review.googlesource.com/14431
Reviewed-by: Russ Cox <rsc@golang.org>
2015-10-26 10:42:38 +00:00
..
archive archive/tar: fix numeric overflow issues in readGNUSparseMap0x1 2015-10-06 17:49:05 +00:00
bufio bufio: fix scanning with a final empty token. 2015-09-25 21:46:13 +00:00
builtin
bytes bytes: improve Compare function on amd64 for large byte arrays 2015-08-26 03:52:20 +00:00
cmd cmd/cgo: clarify C.GoStringN and C.GoBytes docs 2015-10-23 22:23:05 +00:00
compress compress/flate: improve inflate speed by reading more bits at a time 2015-10-19 00:01:31 +00:00
container
crypto crypto/cipher: fix CTR infinite loop with large block sizes 2015-10-20 21:38:36 +00:00
database/sql database/sql: use RWMutex for driver registration 2015-10-23 04:33:50 +00:00
debug debug/gosym: clean up and modernize pclntab_test 2015-10-07 17:01:59 +00:00
encoding encoding/json: simplify encodeState.{string, stringBytes} 2015-10-14 23:29:14 +00:00
errors
expvar
flag flag: add comment stating that Set is called in sequence across the command line 2015-07-16 05:33:47 +00:00
fmt fmt: Add support for capital '%X' format verb for scanning 2015-10-20 01:08:54 +00:00
go cmd/compile/internal/gc: compact binary export format 2015-10-22 21:01:29 +00:00
hash hash/crc32: add AMD64 optimized IEEE CRC calculation 2015-09-16 15:42:42 +00:00
html html/template: include itself while cloning 2015-10-20 23:53:27 +00:00
image image: add NYCbCrA types. 2015-10-11 11:07:25 +00:00
index/suffixarray
internal go/format, cmd/gofmt: avoid dependency on internal package format 2015-09-30 16:32:47 +00:00
io io: simplify documentation for ByteReader 2015-10-06 02:21:29 +00:00
log log/syslog: disable unix/unixgram tests on android 2015-10-21 17:56:51 +00:00
math math: fix normalization bug in pure-Go sqrt 2015-10-23 18:29:10 +00:00
mime mime: Remove an allocation in word decoding. 2015-10-18 17:31:52 +00:00
net net/url: fix mentions of URL.EscapedPath method 2015-10-23 22:22:49 +00:00
os os/exec: make Cmd.Output include stderr in ExitError 2015-10-22 14:08:10 +00:00
path path/filepath: test EvalSymlinks returns canonical path on windows 2015-10-22 04:35:50 +00:00
reflect reflect: adjust access to unexported embedded structs 2015-10-26 10:14:38 +00:00
regexp regexp: fix slice bounds out of range panics 2015-10-23 03:30:25 +00:00
runtime runtime: copy sqrt normalization bugfix from math 2015-10-23 23:43:47 +00:00
sort sort: Fix typo in Stable() comment 2015-08-17 06:58:16 +00:00
strconv strconv: slightly simplified roundShortest; better comments 2015-09-23 21:14:29 +00:00
strings strings: Add examples for HasPrefix and HasSuffix 2015-10-23 01:57:15 +00:00
sync runtime, sync/atomic: add memory barriers in arm cas routines 2015-07-30 20:11:11 +00:00
syscall runtime, syscall: add calls to msan functions 2015-10-21 19:17:46 +00:00
testing testing/quick: terminate for arbitrary recursive types 2015-08-29 19:23:37 +00:00
text text/template: resolve non-empty interface 2015-10-15 05:02:27 +00:00
time time: allow any one- or two-digit day of the month when parsing. 2015-09-10 20:27:53 +00:00
unicode unicode/utf8: added benchmarks 2015-10-26 10:42:38 +00:00
unsafe
vendor/golang.org/x/net/http2/hpack net/http: update copy of http2 2015-10-21 00:28:55 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash androidtest.bash: correct the location of compiled packages 2015-10-21 19:34:27 +00:00
bootstrap.bash build: Fix bootstrap.bash for official source tarballs 2015-09-01 19:52:59 +00:00
buildall.bash
clean.bash build: clean current tree in clean.bash 2015-08-05 19:36:15 +00:00
clean.bat
clean.rc
iostest.bash
make.bash make.bash: abort if $GOROOT_BOOTSTRAP == $GOROOT 2015-08-24 03:04:52 +00:00
make.bat
make.rc
nacltest.bash
race.bash all: link to https instead of http 2015-07-11 14:36:33 +00:00
race.bat all: link to https instead of http 2015-07-11 14:36:33 +00:00
run.bash
run.bat
run.rc