go/src/bufio
Alex Gaynor c2e0f01598 bufio: optimize bufio.Reader.ReadString to avoid an allocation and copy
name                old time/op    new time/op    delta
ReaderReadString-4     226ns ±12%     161ns ±11%  -28.76%  (p=0.008 n=5+5)

name                old alloc/op   new alloc/op   delta
ReaderReadString-4      288B ± 0%      144B ± 0%  -50.00%  (p=0.008 n=5+5)

name                old allocs/op  new allocs/op  delta
ReaderReadString-4      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)

Change-Id: I77f330b8340c2bfbfff1f6f1000170b65953a200
GitHub-Last-Rev: 65d65302a7
GitHub-Pull-Request: golang/go#34706
Reviewed-on: https://go-review.googlesource.com/c/go/+/199257
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-04-28 00:53:32 +00:00
..
bufio.go bufio: optimize bufio.Reader.ReadString to avoid an allocation and copy 2020-04-28 00:53:32 +00:00
bufio_test.go bufio: optimize bufio.Reader.ReadString to avoid an allocation and copy 2020-04-28 00:53:32 +00:00
example_test.go bufio: fix ExampleScanner_Bytes comment, add error check 2019-06-25 00:29:24 +00:00
export_test.go bufio: add Reader.Size and Writer.Size accessors 2017-11-02 17:17:44 +00:00
scan.go scan: for style, adjust code for bad scan read counts 2020-03-25 22:44:57 +00:00
scan_test.go bufio: don't panic when Scanner sees an impossible Read count 2020-03-25 19:16:39 +00:00