1
0
mirror of https://github.com/golang/go synced 2024-10-04 09:21:21 -06:00
go/src/strings
Brad Fitzpatrick 3ddc9ad916 strings: add special cases for Join of 2 and 3 strings
We already had special cases for 0 and 1. Add 2 and 3 for now too.
To be removed if the compiler is improved later (#6714).

This halves the number of allocations and total bytes allocated via
common filepath.Join calls, improving filepath.Walk performance.

Noticed as part of investigating filepath.Walk in #16399.

Change-Id: If7b1bb85606d4720f3ebdf8de7b1e12ad165079d
Reviewed-on: https://go-review.googlesource.com/25005
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-16 00:33:15 +00:00
..
compare_test.go all: single space after period. 2016-03-02 00:13:47 +00:00
compare.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
example_test.go strings: Add examples for HasPrefix and HasSuffix 2015-10-23 01:57:15 +00:00
export_test.go
reader_test.go strings, bytes: fix Reader 0 byte read at EOF 2016-05-03 21:01:13 +00:00
reader.go all: use SeekStart, SeekCurrent, SeekEnd 2016-05-06 00:10:41 +00:00
replace_test.go
replace.go
search_test.go
search.go
strings_amd64.go strings: fix and reenable amd64 Index for 17-31 byte strings 2016-05-27 22:57:32 +00:00
strings_decl.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
strings_generic.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
strings_test.go strings: fix and reenable amd64 Index for 17-31 byte strings 2016-05-27 22:57:32 +00:00
strings.go strings: add special cases for Join of 2 and 3 strings 2016-08-16 00:33:15 +00:00
strings.s