summaryrefslogtreecommitdiff
path: root/src/strconv/strconv_test.go
Commit message (Collapse)AuthorAgeFilesLines
* strconv: pre-allocate in appendQuotedWithRob Pike2019-04-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | The byte-at-a-time allocation done quoting strings in appendQuotedWith grows the output incrementally, which is poor behavior for very large strings. An easy fix is to make sure the buffer has enough room at least for an unquoted string. Add a benchmark with a megabyte of non-ASCII data. Before: 39 allocations. After: 7 allocations. We could do better by doing a lot more work but this seems like a big result for little effort. Fixes #31472. Change-Id: I852139e0a2bd13722c4dd329ded8ae1759abad5b Reviewed-on: https://go-review.googlesource.com/c/go/+/172677 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* strconv: fix function name in errors for AtoiJoe Tsai2016-09-041-0/+31
| | | | | | | | Fixes #16980 Change-Id: I902a02b157c2c7d1772f5122b850dc48b1d7a224 Reviewed-on: https://go-review.googlesource.com/28474 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* build: move package sources from src/pkg to srcRuss Cox2014-09-081-0/+57
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.