aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/bytes
AgeCommit message (Collapse)Author
2012-05-02bytes: add assembly version of Equal for ARMDave Cheney
BenchmarkEqual32 662 159 -75.98% BenchmarkEqual4K 76545 13719 -82.08% BenchmarkEqual4M 90136700 23588870 -73.83% BenchmarkEqual64M 2147483647 1419616000 -42.63% BenchmarkEqual32 48.32 201.15 4.16x BenchmarkEqual4K 53.51 298.56 5.58x BenchmarkEqual4M 46.53 177.81 3.82x BenchmarkEqual64M 27.12 47.27 1.74x R=golang-dev, qyzhai, minux.ma, rsc, iant, nigeltao CC=golang-dev https://golang.org/cl/6118049
2012-04-25bytes: add assembly version of IndexByte for ARMDave Cheney
benchmark old ns/op new ns/op delta BenchmarkIndexByte32 459 126 -72.55% BenchmarkIndexByte4K 52404 10939 -79.13% BenchmarkIndexByte4M 54470800 11177370 -79.48% BenchmarkIndexByte64M 1010803000 178860500 -82.31% benchmark old MB/s new MB/s speedup BenchmarkIndexByte32 69.58 252.63 3.63x BenchmarkIndexByte4K 78.16 374.42 4.79x BenchmarkIndexByte4M 77.00 375.25 4.87x BenchmarkIndexByte64M 66.39 375.20 5.65x R=rsc, minux.ma CC=golang-dev https://golang.org/cl/6106044
2012-02-18bytes: document Compare/Equal semantics for nil arguments, and add tests.David Symonds
R=golang-dev, bradfitz, r, r CC=golang-dev https://golang.org/cl/5676090
2012-02-16godoc: make example code more readable with new comment conventionAndrew Gerrand
go/doc: move Examples to go/ast cmd/go: use go/doc to read examples src/pkg: update examples to use new convention This is to make whole file examples more readable. When presented as a complete function, preceding an Example with its output is confusing. The new convention is to put the expected output in the final comment of the example, preceded by the string "output:" (case insensitive). An idiomatic example looks like this: // This example demonstrates Foo by doing bar and quux. func ExampleFoo() { // example body that does bar and quux // Output: // example output } R=rsc, gri CC=golang-dev https://golang.org/cl/5673053
2012-02-15bytes,strings: make *Reader implement io.ReaderAtBrad Fitzpatrick
R=golang-dev, adg, bradfitz, r CC=golang-dev https://golang.org/cl/5675053
2012-02-15bytes: add ReaderBrad Fitzpatrick
copy of strings/reader{,_test}.go with a few s/string/[]byte/ Fixes #2861 R=adg, rsc, r CC=golang-dev https://golang.org/cl/5666044
2012-02-09bytes.Buffer: return error in WriteTo if buffer is not drainedRob Pike
R=rsc CC=golang-dev https://golang.org/cl/5642065
2012-02-06bytes: API tweaksRob Pike
- fix documentation for NewBuffer and NewBufferString - document and implement behavior of Truncate on invalid lengths Fixes #2837. R=rsc, adg CC=golang-dev https://golang.org/cl/5637044
2012-01-30build: remove Make.pkg, Make.toolRuss Cox
Consequently, remove many package Makefiles, and shorten the few that remain. gomake becomes 'go tool make'. Turn off test phases of run.bash that do not work, flagged with $BROKEN. Future CLs will restore these, but this seemed like a big enough CL already. R=golang-dev, r CC=golang-dev https://golang.org/cl/5601057
2012-01-22bytes: delete the test for huge buffersRob Pike
It takes too much memory to be reliable and causes trouble on 32-bit machines. Sigh. Fixes #2756. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5567043
2012-01-21bytes.Buffer: remove dead code, complete documentationRobert Griesemer
R=r, dave, r CC=golang-dev https://golang.org/cl/5533086
2012-01-21bytes.Buffer: restore panic on out-of-memoryRob Pike
Make the panic detectable, and use that in ioutil.ReadFile to give an error if the file is too big. R=golang-dev, minux.ma, bradfitz CC=golang-dev https://golang.org/cl/5563045
2012-01-20bytes: simplified logicRobert Griesemer
Also: Avoid potential crash due to reslicing of nil buffer. R=r CC=golang-dev https://golang.org/cl/5556075
2012-01-20bytes.Buffer: turn buffer size overflows into errorsRob Pike
Fixes #2743. R=golang-dev, gri, r CC=golang-dev https://golang.org/cl/5556072
2012-01-18pkg/bytes: add the usual copyright notice to example_test.goOlivier Duperray
R=golang-dev, gri CC=golang-dev https://golang.org/cl/5553050
2012-01-13bytes: make Write and WriteString code look the sameBrad Fitzpatrick
R=golang-dev, r CC=golang-dev https://golang.org/cl/5540056
2011-12-26bytes.Buffer: read of 0 bytes at EOF shouldn't be an EOFRob Pike
This corner case arose doing an RPC with a empty-slice payload. Ouch. R=golang-dev, iant CC=golang-dev https://golang.org/cl/5505073
2011-12-20panics: use the new facilities of testing.B insteadRob Pike
Lots of panics go away. Also fix a name error in html/template. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5498045
2011-12-16testing: trim spaces before comparing example outputAndrew Gerrand
bytes: add two Buffer examples R=golang-dev, r CC=golang-dev https://golang.org/cl/5490048
2011-12-15go/printer, gofmt: don't write too many newlinesRobert Griesemer
In some rare cases, gofmt would accept more than the maximum number of empty lines (1) between source code snippets. The actual change is in printer.go, lines 773-775; the rest is some minor restructuring. Applied gofmt -w src misc . Fixes #2387. R=golang-dev, r CC=golang-dev https://golang.org/cl/5496047
2011-12-08update tree for new default type ruleRuss Cox
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5448091
2011-12-07bytes: lost edit from earlier CLRuss Cox
R=iant CC=golang-dev https://golang.org/cl/5450125
2011-12-07bytes: faster Count, Index, EqualRuss Cox
Benchmarks are from GOARCH=amd64 on a MacPro5,1. benchmark old MB/s new MB/s speedup bytes_test.BenchmarkEqual32 452.89 891.07 1.97x bytes_test.BenchmarkEqual4K 852.71 1700.44 1.99x bytes_test.BenchmarkEqual4M 841.53 1587.93 1.89x bytes_test.BenchmarkEqual64M 838.22 1578.14 1.88x bytes_test.BenchmarkIndex32 58.02 48.99 0.84x bytes_test.BenchmarkIndex4K 48.26 41.32 0.86x bytes_test.BenchmarkIndex4M 48.20 41.24 0.86x bytes_test.BenchmarkIndex64M 48.08 41.21 0.86x bytes_test.BenchmarkIndexEasy32 410.04 546.82 1.33x bytes_test.BenchmarkIndexEasy4K 849.26 14257.37 16.79x bytes_test.BenchmarkIndexEasy4M 854.54 17222.15 20.15x bytes_test.BenchmarkIndexEasy64M 843.57 11060.40 13.11x bytes_test.BenchmarkCount32 57.24 50.68 0.89x bytes_test.BenchmarkCount4K 48.19 41.82 0.87x bytes_test.BenchmarkCount4M 48.18 41.74 0.87x bytes_test.BenchmarkCount64M 48.17 41.71 0.87x bytes_test.BenchmarkCountEasy32 433.11 547.44 1.26x bytes_test.BenchmarkCountEasy4K 1130.59 14194.06 12.55x bytes_test.BenchmarkCountEasy4M 1131.23 17231.18 15.23x bytes_test.BenchmarkCountEasy64M 1111.40 11068.88 9.96x The non-easy Count/Index benchmarks are a worst case input. regexp.BenchmarkMatchEasy0_32 237.46 221.47 0.93x regexp.BenchmarkMatchEasy0_1K 553.53 1019.72 1.84x regexp.BenchmarkMatchEasy0_32K 693.99 1672.06 2.41x regexp.BenchmarkMatchEasy0_1M 688.72 1611.68 2.34x regexp.BenchmarkMatchEasy0_32M 680.70 1565.05 2.30x regexp.BenchmarkMatchEasy1_32 165.56 243.08 1.47x regexp.BenchmarkMatchEasy1_1K 336.45 496.32 1.48x regexp.BenchmarkMatchEasy1_32K 302.80 425.63 1.41x regexp.BenchmarkMatchEasy1_1M 300.42 414.20 1.38x regexp.BenchmarkMatchEasy1_32M 299.64 413.47 1.38x R=golang-dev, r, iant CC=golang-dev https://golang.org/cl/5451116
2011-11-28bytes: fix test outputChristopher Wedgwood
R=rsc, gri CC=golang-dev https://golang.org/cl/5441048
2011-11-13various: avoid func compareRuss Cox
R=gri, r, bradfitz CC=golang-dev https://golang.org/cl/5371074
2011-11-08renaming_2: gofix -r go1pkgrename src/pkg/[a-l]*Rob Pike
R=rsc CC=golang-dev https://golang.org/cl/5358041
2011-11-04bytes: fix typo and resolve to be less idiotic next timeAndrew Gerrand
R=bradfitz CC=golang-dev https://golang.org/cl/5340044
2011-11-04bytes: add Contains functionAndrew Gerrand
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5349041
2011-11-03all: rename os.EOF to io.EOF in various non-code contextsVincent Vanackere
R=golang-dev, r CC=golang-dev https://golang.org/cl/5334050
2011-11-01src/pkg/[a-m]*: gofix -r error -force=errorRuss Cox
R=golang-dev, iant CC=golang-dev https://golang.org/cl/5322051
2011-10-25bytes, strings: use runeRuss Cox
Various rune-based APIs change. R=golang-dev, r CC=golang-dev https://golang.org/cl/5306044
2011-10-12updates: append(y,[]byte(z)...) -> append(y,z...)"Christopher Wedgwood
(more are possible but omitted for now as they are part of specific tests where rather than changing what is there we should probably expand the tests to cover the new case) R=rsc, dvyukov CC=golang-dev https://golang.org/cl/5247058
2011-09-26bytes: add EqualFoldRuss Cox
R=golang-dev, r, r CC=golang-dev https://golang.org/cl/5123047
2011-09-21bytes: fix Replace so it actually copiesGustavo Niemeyer
The documentation for bytes.Replace says it copies the slice but it won't necessarily copy them. Since the data is mutable, breaking the contract is an issue. We either have to fix this by making the copy at all times, as suggested in this CL, or we should change the documentation and perhaps make better use of the fact it's fine to mutate the slice in place otherwise. R=golang-dev, bradfitz, adg, rsc CC=golang-dev https://golang.org/cl/5081043
2011-08-26bytes.Buffer: clarify that NewBuffer is not for beginnersRob Pike
R=golang-dev, adg CC=golang-dev https://golang.org/cl/4965048
2011-07-14go/printer: changed max. number of newlines from 3 to 2Robert Griesemer
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go (cd src/cmd/gofix/testdata; gofmt -w *.in *.out) (cd src/pkg/go/printer; gotest -update) gofmt -w misc src runs all tests R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4715041
2011-06-28strings.Split: make the default to split all.Rob Pike
Change the signature of Split to have no count, assuming a full split, and rename the existing Split with a count to SplitN. Do the same to package bytes. Add a gofix module. R=adg, dsymonds, alex.brainman, rsc CC=golang-dev https://golang.org/cl/4661051
2011-06-22os.Error API: don't export os.ErrorString, use os.NewError consistentlyRobert Griesemer
This is a core API change. 1) gofix misc src 2) Manual adjustments to the following files under src/pkg: gob/decode.go rpc/client.go os/error.go io/io.go bufio/bufio.go http/request.go websocket/client.go as well as: src/cmd/gofix/testdata/*.go.in (reverted) test/fixedbugs/bug243.go 3) Implemented gofix patch (oserrorstring.go) and test case (oserrorstring_test.go) Compiles and runs all tests. R=r, rsc, gri CC=golang-dev https://golang.org/cl/4607052
2011-04-20src/pkg: make package doc comments consistently start with "Package foo".Nigel Tao
R=rsc CC=golang-dev https://golang.org/cl/4442064
2011-03-29bytes, strings: simplify JoinEvan Shaw
R=gri, rsc CC=golang-dev https://golang.org/cl/4300044
2011-03-25testing: shorten some tests.Rob Pike
These are the top runners. More to come. Also print two digits of timing info under -test.v. R=rsc CC=golang-dev https://golang.org/cl/4317044
2011-02-11bytes: fix bugs in buffer.ReadBytesEvan Shaw
Fixes #1498. R=golang-dev, mattn, r, rsc CC=golang-dev https://golang.org/cl/4140041
2011-02-09buffer.go: minor optimization, expanded commentRobert Griesemer
R=r CC=golang-dev https://golang.org/cl/4169043
2011-01-27bytes: Add Buffer.ReadBytes, Buffer.ReadStringEvan Shaw
R=golang-dev, r CC=golang-dev https://golang.org/cl/4000046
2011-01-14bytes.Buffer: fix typo in comment (doubled 'to')Rob Pike
R=ken2 CC=golang-dev https://golang.org/cl/4035041
2011-01-09bytes: fix TrimSpace typoPeter Mundy
Fixes #1401. R=golang-dev, agl1 CC=golang-dev https://golang.org/cl/3937041
2011-01-07bytes.Buffer: Fix bug in UnreadByte.Rob Pike
Error check was inverted. Fixes #1396. R=rsc, adg CC=golang-dev https://golang.org/cl/3851042
2010-12-07throughout: fix broken calls to Printf etc.Rob Pike
I have written a tool to verify Printf calls, and although it's not ready to be reviewed yet it's already uncovered a spate of problems in the repository. I'm sending this CL to break the changes into pieces; as the tool improves it will find more, I'm sure. R=rsc CC=golang-dev https://golang.org/cl/3427043
2010-12-06use the new %U format for runesRob Pike
R=rsc CC=golang-dev https://golang.org/cl/3483041
2010-12-06bytes: add Buffer.UnreadRune, Buffer.UnreadByteRoger Peppe
R=rsc, r CC=golang-dev https://golang.org/cl/3421041