aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-01-25bufio: realign struct Scannerbench-beforeShulhan
This reduce the Scanner allocation size from 112 to 72 bytes.
2024-01-25bufio: realign struct ReaderShulhan
This reduce the Reader allocation size from 72 to 40 bytes and Writer allocation size from 64 to 40 bytes.
2024-01-25mime/quotedprintable: fix encoding where a period alone on a lineShulhan
Given the following example of message body, A line that precisely have length 75 with . + LF will cause DATA truncation.\n \n Footer.\n The quotedprintable Writer will encode the message into, A line ... truncation=\r\n .\r\n \r\n Footer.\r\n If we pass the Writer output into SMTP DATA command, the server read the "\r\n.\r\n" as the end of DATA which cause the message truncated on the receiver. This changes fix this issue by encode the period at the end with "=2E" based on recommendation in RFC 2049 Section 3, point (8) [1]. [1] https://www.rfc-editor.org/rfc/rfc2049.html#section-3 Fixes #61235 Change-Id: I350387b183ac6b25886f4084a060dcfcb48232a9
2024-01-25encoding/json: optimize isValidNumber functionShulhan
Instead of re-slicing the string for checking the value, use single index variable. Benchmark result, name old time/op new time/op delta NumberIsValid-8 19.0ns ± 0% 14.5ns ± 1% -23.70% (p=0.008 n=5+5) name old alloc/op new alloc/op delta NumberIsValid-8 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta NumberIsValid-8 0.00 0.00 ~ (all equal) Change-Id: I4698c5db134998f83ff47fb3add6a04ba6ec3aa0
2024-01-25testing: change the FAIL and SKIP prefix to "!!!" and "???"Shulhan
Previously, there are three output of message printed by test or benchmark: PASS, SKIP, or FAIL. All of them use the same prefix "---". In case we have a module that run many many tests, it's become hard to differentiate between PASS, SKIP, and FAIL. This changes differentiate the SKIP and FAIL using different prefix. For SKIP we prefix it with "???", for FAIL we prefix it with "!!!".
2024-01-25all: prealloc slice with possible minimum capabilitiesShulhan
2024-01-25encoding/binary: add benchmark for writing slice of uint8Shulhan
2024-01-25all: add Makefile to rebuild go and other tools from sourceShulhan
2024-01-24Revert "archive/tar: add FileInfoNames interface"Cherry Mui
This reverts CL 514235. Also reverts CL 518056 which is a followup fix. Reason for revert: Proposal #50102 defined an interface that is too specific to UNIX-y systems and also didn't make much sense. The proposal is un-accepted, and we'll revisit in Go 1.23. Fixes (via backport) #65245. Updates #50102. Change-Id: I41ba0ee286c1d893e6564a337e5d76418d19435d Reviewed-on: https://go-review.googlesource.com/c/go/+/558295 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-01-24net: ignore Dial errors in TestAcceptTimeoutBryan C. Mills
Also use DialContext instead of just Dial so that we can ensure the call returns before we close the listener. The Dial in this test is intended to complete before the call to Accept, but there is no synchronization to ensure that and sometimes it doesn't happen. That's ok and mostly immaterial to the test, but it does mean we need to ignore Dial errors (which can happen when the listener is closed), and we need to be a little more careful about not dialing a port that may have already been reused by some other test. Fixes #65240. Updates #17948. Change-Id: Ife1b5c3062939441b58f4c096461bf5d7841889b Reviewed-on: https://go-review.googlesource.com/c/go/+/558175 Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-24reflect: fix isRegularMemory at case ArrayJes Cok
To match cmd/compile/internal/compare.IsRegularMemory, this CL adds code for empty arrays of comparable element type. Change-Id: I205fb9bfda60be6c9aac2d9098ed3f0eb51cd0fa GitHub-Last-Rev: 40db7ed510883633374895271145678a51418426 GitHub-Pull-Request: golang/go#65252 Reviewed-on: https://go-review.googlesource.com/c/go/+/558155 Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: qiulaidongfeng <2645477756@qq.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: qiulaidongfeng <2645477756@qq.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2024-01-24doc/next: initial contentsJonathan Amsterdam
Initialize the doc/next directory for the next release by copying the contents of doc/initial into it. Also, rewrite doc/README.md to add release instructions and to separate information for developers from information for the release team. Change-Id: Ie1e5c2ddae7a8d301e9b2f8a68925519648aa84d Reviewed-on: https://go-review.googlesource.com/c/go/+/557535 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-01-24runtime: short path for equal pointers in arm64 memequalMauri de Souza Meneguzzo
If memequal is invoked with the same pointers as arguments it ends up comparing the whole memory contents, instead of just comparing the pointers. This effectively makes an operation that could be O(1) into O(n). All the other architectures already have this optimization in place. For instance, arm64 also have it, in memequal_varlen. Such optimization is very specific, one case that it will probably benefit is programs that rely heavily on interning of strings. goos: darwin goarch: arm64 pkg: bytes │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ Equal/same/1-8 2.678n ± ∞ ¹ 2.400n ± ∞ ¹ -10.38% (p=0.008 n=5) Equal/same/6-8 3.267n ± ∞ ¹ 2.431n ± ∞ ¹ -25.59% (p=0.008 n=5) Equal/same/9-8 2.981n ± ∞ ¹ 2.385n ± ∞ ¹ -19.99% (p=0.008 n=5) Equal/same/15-8 2.974n ± ∞ ¹ 2.390n ± ∞ ¹ -19.64% (p=0.008 n=5) Equal/same/16-8 2.983n ± ∞ ¹ 2.380n ± ∞ ¹ -20.21% (p=0.008 n=5) Equal/same/20-8 3.567n ± ∞ ¹ 2.384n ± ∞ ¹ -33.17% (p=0.008 n=5) Equal/same/32-8 3.568n ± ∞ ¹ 2.385n ± ∞ ¹ -33.16% (p=0.008 n=5) Equal/same/4K-8 78.040n ± ∞ ¹ 2.378n ± ∞ ¹ -96.95% (p=0.008 n=5) Equal/same/4M-8 78713.000n ± ∞ ¹ 2.385n ± ∞ ¹ -100.00% (p=0.008 n=5) Equal/same/64M-8 1348095.000n ± ∞ ¹ 2.381n ± ∞ ¹ -100.00% (p=0.008 n=5) geomean 43.52n 2.390n -94.51% ¹ need >= 6 samples for confidence interval at level 0.95 │ old.txt │ new.txt │ │ B/s │ B/s vs base │ Equal/same/1-8 356.1Mi ± ∞ ¹ 397.3Mi ± ∞ ¹ +11.57% (p=0.008 n=5) Equal/same/6-8 1.711Gi ± ∞ ¹ 2.298Gi ± ∞ ¹ +34.35% (p=0.008 n=5) Equal/same/9-8 2.812Gi ± ∞ ¹ 3.515Gi ± ∞ ¹ +24.99% (p=0.008 n=5) Equal/same/15-8 4.698Gi ± ∞ ¹ 5.844Gi ± ∞ ¹ +24.41% (p=0.008 n=5) Equal/same/16-8 4.995Gi ± ∞ ¹ 6.260Gi ± ∞ ¹ +25.34% (p=0.008 n=5) Equal/same/20-8 5.222Gi ± ∞ ¹ 7.814Gi ± ∞ ¹ +49.63% (p=0.008 n=5) Equal/same/32-8 8.353Gi ± ∞ ¹ 12.496Gi ± ∞ ¹ +49.59% (p=0.008 n=5) Equal/same/4K-8 48.88Gi ± ∞ ¹ 1603.96Gi ± ∞ ¹ +3181.17% (p=0.008 n=5) Equal/same/4M-8 49.63Gi ± ∞ ¹ 1637911.85Gi ± ∞ ¹ +3300381.91% (p=0.008 n=5) Equal/same/64M-8 46.36Gi ± ∞ ¹ 26253069.97Gi ± ∞ ¹ +56626517.99% (p=0.008 n=5) geomean 6.737Gi 122.7Gi +1721.01% ¹ need >= 6 samples for confidence interval at level 0.95 Fixes #64381 Change-Id: I7d423930a688edd88c4ba60d45e097296d9be852 GitHub-Last-Rev: ae8189fafb1cba87b5394f09f971746ae9299273 GitHub-Pull-Request: golang/go#64419 Reviewed-on: https://go-review.googlesource.com/c/go/+/545416 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com>
2024-01-24src/cmd/relnote, doc/next: add release note checkJonathan Amsterdam
Add a test that every file in api/next has corresponding release note fragments. Vendor in golang.org/x/build/relnote, which brings along some other things. Modify dist/test.go to configure the test to run on some trybots. For #64169. Change-Id: If87d11350ea6b2605bc3ab31c491fa28f1d6ee7d Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/556995 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2024-01-24cmd/go: add GORISCV64 environment variableMark Ryan
The variable represents the RISC-V user-mode application profile for which to compile. Valid values are rva20u64 (the default) and rva22u64. Setting GORISCV64=rva20u64 defines the riscv64.rva20u64 build tag, sets the internal variable buildcfg.GORISCV64 to 20 and defines the macro GORISCV64_rva20u64 for use in assembly language code. Setting GORISCV64=rva22u64 defines the riscv64.rva20u64 and riscv64.rva22u64 build tags, sets the internal variable buildcfg.GORISCV64 to 22 and defines the macro GORISCV64_rva22u64 for use in assembly language code. This patch only provides a mechanism for the compiler and hand-coded assembly language functions to take advantage of the RISC-V extensions mandated by the application profiles. Further patches will be required to get the compiler/assembler and assembly language functions to actually generate and use these extensions. Fixes #61476 Change-Id: I9195ae6ee71703cd2112160e89157ab63b8391af Reviewed-on: https://go-review.googlesource.com/c/go/+/541135 Reviewed-by: M Zhuo <mengzhuo1203@gmail.com> Reviewed-by: Joel Sing <joel@sing.id.au> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Wang Yaduo <wangyaduo@linux.alibaba.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: M Zhuo <mengzhuo1203@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2024-01-23cmd/go/internal/str,cmd/go/internal/work: remove redundant Containsapocelipes
"cmd/go/internal/str.Contains" does the same thing as the "slices.Contains". The name "str.Contains" is also easily confused with "strings.Contains". Given that the slices package is already used in the package, replace "str.Contains" with "slices.Contains". "str.Contains" is no longer used so just remove it. Change-Id: I80572464bd17d4a60e7ff41db3a77c4d0bd03fa3 GitHub-Last-Rev: e74d333f0fd4b9558382e9dba0f77717089f45a9 GitHub-Pull-Request: golang/go#64136 Reviewed-on: https://go-review.googlesource.com/c/go/+/542416 Auto-Submit: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2024-01-23net,internal/poll: load ws2_32.dll only when net is importedqmuntal
On Windows, ws2_32.dll is loaded and WSA initialized even if websockets are not used. This CL delays loading of ws2_32.dll and starting WSA until net is initialized. Change-Id: I07ea8241d79709cd4e80d29ba0d792c7444bbfe9 Reviewed-on: https://go-review.googlesource.com/c/go/+/557015 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-23net: move cgo-using darwin test to separate packageRuss Cox
It is a goal / requirement that nothing in the standard library on darwin require cgo, and this test-only file makes net use cgo on darwin. Move it elsewhere. Change-Id: I6c11a8391d3913f73ce0098ba63b29adf5864f93 Reviewed-on: https://go-review.googlesource.com/c/go/+/549255 Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Russ Cox <rsc@golang.org>
2024-01-23cmd/go: add test case for issue 64738Russ Cox
The straight revert in CL 551215 fixed this issue. Add a test case to make sure we don't reintroduce it. Test case copied from CL 550237 (by bcmills). Fixes #64738. Change-Id: I9654a1fd46fe1a1cc63ee6645a552ec21d720ad0 Reviewed-on: https://go-review.googlesource.com/c/go/+/551255 Reviewed-by: Michael Matloob <matloob@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Bryan Mills <bcmills@google.com>
2024-01-23net: unskip and attempt to deflake TestAcceptTimeoutBryan C. Mills
This test has been unconditionally skipped for over five years. It may be that whatever was causing it to flake has been fixed. And if it hasn't been fixed, it isn't providing any value. Let's unskip it for the Go 1.23 development cycle and see what happens. Let's also use a separate listener for each test case, so that a leaked Dial goroutine from one case won't interfere with the other. Fixes #17948 (maybe). Change-Id: I239f22ca5d5a44388b9aa0ed4d81e451c6342617 Reviewed-on: https://go-review.googlesource.com/c/go/+/548940 Commit-Queue: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-23internal/reflectlite: delete TODO pass safe to packEface don't need to copy ↵qiulaidongfeng
if safe==true reflect on the https://go-review.googlesource.com/c/go/+/548436 delete TODO the same. Change-Id: I5b278cbfcb4108e5ffb332ba82dafb1eaa2bd6b2 GitHub-Last-Rev: cfc39509085477e9cba8e8ba1698653837a12301 GitHub-Pull-Request: golang/go#64628 Reviewed-on: https://go-review.googlesource.com/c/go/+/548615 Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2024-01-23reflect: delete TODO pass safe to packEface don't need to copy if safe==trueqiulaidongfeng
valueInterface not copy result in the follow incorrect behavior w1. x := ValueOf(&v).Elem() r1. iface := Value.Interface() w2. x.Set() or x.SetT() The write operation of W2 will be observed by the read operation of r1, but the existing behavior is not. The valueInterface in deepValueEqual can, in theory, pass safe==true to not copy the object, but there is no benchmark to indicate that the memory allocation has changed, maybe we don't actually need safe==true here. Change-Id: I55c423fd50adac8822a7fdbfe67af89ee223eace GitHub-Last-Rev: 4a6386709817f3ea6055711dd39d2694d58b3043 GitHub-Pull-Request: golang/go#64618 Reviewed-on: https://go-review.googlesource.com/c/go/+/548436 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org>
2024-01-23net: report timeouts more aggressively in Accept in the fake implementationBryan C. Mills
This ensures that if the listener has already timed out when Accept is called, Accept always returns an error instead of instantaneously accepting a connection that was already pending. For #17948. Change-Id: Iabef7121590df3dcc2fe428429d7c2bc2bcb6cd5 Reviewed-on: https://go-review.googlesource.com/c/go/+/557438 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Damien Neil <dneil@google.com>
2024-01-23runtime,internal/poll: move websocket handling out of the runtime on Windowsqmuntal
On Windows, the netpoll is currently coupled with the websocket usage in the internal/poll package. This CL moves the websocket handling out of the runtime and puts it into the internal/poll package, which already contains most of the async I/O logic for websockets. This is a good refactor per se, as the Go runtime shouldn't know about websockets. In addition, it will make it easier (in a future CL) to only load ws2_32.dll when the Go program actually uses websockets. Change-Id: Ic820872cf9bdbbf092505ed7f7504edb6687735e Reviewed-on: https://go-review.googlesource.com/c/go/+/556936 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-01-23fmt: don't pad strings with zerosRob Pike
It's what the documentation says, and oddly it already behaves correctly for right padding, not left. (We never pad with zeros on the right.) Just don't do it. Fixes #56486 Change-Id: I2465edea93c69084e33bee0d945d5a1b85e6cd14 Reviewed-on: https://go-review.googlesource.com/c/go/+/555776 Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Rob Pike <r@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-01-23cmd/cgo/internal/test: skip TestCallbackCallersSEH when internal linkingqmuntal
TestCallbackCallersSEH is flaky when using the internal linker. Skip it for now until the flakiness is resolved. Updates #65116 Change-Id: I7628b07eaff8be00757d5604722f30aede25fce5 Reviewed-on: https://go-review.googlesource.com/c/go/+/556635 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-23cmd/compile/internal/ssagen,runtime: merge trace consts into internal/abiqiulaidongfeng
For #59670 Change-Id: Iec85ee7312bb566b3f1224424f7d27bf4e408b13 GitHub-Last-Rev: c620abf9673e166505821d75717e820776abc302 GitHub-Pull-Request: golang/go#64905 Reviewed-on: https://go-review.googlesource.com/c/go/+/553295 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2024-01-23reflect: StructOf set abi.TFlagRegularMemoryqiulaidongfeng
Complete a TODO. Change-Id: I791d27266ccee69c371524e298120765f5736cf8 GitHub-Last-Rev: 8878003efa2f9f3d8609b88073c982d21ece774b GitHub-Pull-Request: golang/go#64617 Reviewed-on: https://go-review.googlesource.com/c/go/+/548435 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2024-01-23cmd/compile: use MapMaxKeyBytes,MapMaxElemBytes,MapBucketCount of internal/abiqiulaidongfeng
For #59670 Change-Id: I651e211650e69989c598ab16202105bc6e68d67e GitHub-Last-Rev: fba087a35fa563cba0dc5f70e8c9d9108dc1f1d4 GitHub-Pull-Request: golang/go#64776 Reviewed-on: https://go-review.googlesource.com/c/go/+/550615 Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-23hash/crc32: fix codegen to align with manual changesOlivier Mengué
Update gen_const_ppc64le.go to match the manual changes applied in CL 478976. Change-Id: I79a0d014a2a151750f898517b2771b312f3437bc Reviewed-on: https://go-review.googlesource.com/c/go/+/555996 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
2024-01-23cmd/compile: improve integer comparisons with numeric boundsJorropo
This do: - Fold always false or always true comparisons for ints and uint. - Reduce < and <= where the true set is only one value to == with such value. Change-Id: Ie9e3f70efd1845bef62db56543f051a50ad2532e Reviewed-on: https://go-review.googlesource.com/c/go/+/555135 Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22crypto/sha512: provide optimised assembly for riscv64Joel Sing
Provide an optimised assembly implementation of sha512 for riscv64. This results in significant performance gains. On a StarFive VisionFive 2: │ sha512a │ sha512b │ │ sec/op │ sec/op vs base │ Hash8Bytes/New-4 7.998µ ± 0% 6.962µ ± 0% -12.96% (p=0.000 n=10) Hash8Bytes/Sum384-4 8.113µ ± 0% 6.651µ ± 0% -18.02% (p=0.000 n=10) Hash8Bytes/Sum512-4 8.269µ ± 0% 6.748µ ± 0% -18.39% (p=0.000 n=10) Hash1K/New-4 57.38µ ± 0% 36.92µ ± 0% -35.66% (p=0.000 n=10) Hash1K/Sum384-4 57.47µ ± 0% 36.57µ ± 0% -36.37% (p=0.000 n=10) Hash1K/Sum512-4 57.61µ ± 0% 36.75µ ± 0% -36.21% (p=0.000 n=10) Hash8K/New-4 402.5µ ± 0% 245.4µ ± 0% -39.02% (p=0.000 n=10) Hash8K/Sum384-4 402.5µ ± 0% 245.1µ ± 0% -39.12% (p=0.000 n=10) Hash8K/Sum512-4 402.7µ ± 0% 245.3µ ± 0% -39.09% (p=0.000 n=10) │ sha512a │ sha512b │ │ B/s │ B/s vs base │ Hash8Bytes/New-4 976.6Ki ± 0% 1123.0Ki ± 0% +15.00% (p=0.000 n=10) Hash8Bytes/Sum384-4 966.8Ki ± 0% 1171.9Ki ± 0% +21.21% (p=0.000 n=10) Hash8Bytes/Sum512-4 947.3Ki ± 0% 1162.1Ki ± 1% +22.68% (p=0.000 n=10) Hash1K/New-4 17.01Mi ± 0% 26.45Mi ± 0% +55.47% (p=0.000 n=10) Hash1K/Sum384-4 16.99Mi ± 0% 26.70Mi ± 0% +57.13% (p=0.000 n=10) Hash1K/Sum512-4 16.95Mi ± 0% 26.57Mi ± 0% +56.74% (p=0.000 n=10) Hash8K/New-4 19.41Mi ± 0% 31.83Mi ± 0% +63.99% (p=0.000 n=10) Hash8K/Sum384-4 19.41Mi ± 0% 31.88Mi ± 0% +64.28% (p=0.000 n=10) Hash8K/Sum512-4 19.40Mi ± 0% 31.85Mi ± 0% +64.21% (p=0.000 n=10) Change-Id: I92629a106b75b0526e9f2a8fe3cc4a6f7fc63c8c Reviewed-on: https://go-review.googlesource.com/c/go/+/518631 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: M Zhuo <mzh@golangcn.org> Reviewed-by: Wang Yaduo <wangyaduo@linux.alibaba.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Mark Ryan <markdryan@rivosinc.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-01-22Revert "cmd/preprofile: Add preprocess tool to pre-parse the profile file."Michael Pratt
This reverts CL 529738. Reason for revert: Breaking longtest builders For #58102. Fixes #65220. Change-Id: Id295e3249da9d82f6a9e4fc571760302a1362def Reviewed-on: https://go-review.googlesource.com/c/go/+/557460 Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22runtime: use the correct M ID for syscalling goroutines in tracesMichael Anthony Knyszek
Earlier in the development of the new tracer, m.id was used as a the canonical ID for threads. Later, we switched to m.procid because it matches the underlying OS resource. However, in that switch, we missed a spot. The tracer catches and emits statuses for goroutines that have remained in either waiting or syscall across a whole generation, and emits a thread ID for the latter set. The ID being used here, however, was m.id instead of m.procid, like the rest of the tracer. This CL also adds a regression test. In order to make the regression test actually catch the failure, we also have to make the parser a little less lenient about GoStatus events with GoSyscall: if this isn't the first generation, then we should've seen the goroutine bound to an M already when its status is getting emitted for its context. If we emit the wrong ID, then we'll catch the issue when we emit the right ID when the goroutine exits the syscall. Fixes #65196. Change-Id: I78b64fbea65308de5e1291c478a082a732a8bf9f Reviewed-on: https://go-review.googlesource.com/c/go/+/557456 Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22cmd/preprofile: Add preprocess tool to pre-parse the profile file.Jin Lin
The pgo compilation time is very long if the profile file is large. We added a preprocess tool to pre-parse profile file in order to expedite the compile time. Change-Id: I6f50bbd01f242448e2463607a9b63483c6ca9a12 Reviewed-on: https://go-review.googlesource.com/c/go/+/529738 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-01-22net: delete TestListenCloseListenBryan C. Mills
In CL 557177, I attempted to fix a logical race in this test (#65175). However, I introduced a data race in the process (#65209). The race was reported on the windows-amd64-race builder. When I tried to reproduce it on linux/amd64, I added a time.Sleep in the Accept loop. However, that Sleep causes the test to fail outright with EADDRINUSE, which suggests that my earlier guess about the open Conn preventing reuse of the port was, in fact, incorrect. On some platforms we could instead use SO_REUSEPORT and avoid closing the first Listener entirely, but that wouldn't be even remotely in the spirit of the original test. Since I don't see a way to preserve the test in a way that is not inherently flaky / racy, I suggest that we just delete it. It was originally added as a regression test for a bug in the nacl port, which no longer exists anyway. (Some of that code may live on in the wasm port, but it doesn't seem worth maintaining a flaky port-independent test to maintain a regression test for a bug specific to secondary platforms.) Fixes #65209. Updates #65175. Change-Id: I32f9da779d24f2e133571f0971ec460cebe7820a Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-race Reviewed-on: https://go-review.googlesource.com/c/go/+/557536 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>
2024-01-22net/mail: properly handle special characters in phrase and obs-phraseRoland Shoemaker
Fixes a couple of misalignments with RFC 5322 which introduce significant diffs between (mostly) conformant parsers. This change reverts the changes made in CL50911, which allowed certain special RFC 5322 characters to appear unquoted in the "phrase" syntax. It is unclear why this change was made in the first place, and created a divergence from comformant parsers. In particular this resulted in treating comments in display names incorrectly. Additionally properly handle trailing malformed comments in the group syntax. Fixes #65083 Change-Id: I00dddc044c6ae3381154e43236632604c390f672 Reviewed-on: https://go-review.googlesource.com/c/go/+/555596 Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22runtime: simplify freedefer logicAustin Clements
Currently, freedefer's API forces a subtle and fragile situation. It requires that the caller unlink the _defer from the G list, but freedefer itself is responsible for zeroing some _defer fields. In the window between these two steps, we have to prevent stack growth because stack growth walks the defer list (which no longer contains the unlinked defer) to adjust pointers, and would thus leave an unadjusted and potentially invalid pointer behind in the _defer before freedefer zeroes it. This setup puts part of this subtle responsibility on the caller and also means freedefer must be nosplit, which forces other shenanigans to avoid nosplit overflows. We can simplify all of this by replacing freedefer with a new popDefer function that's responsible for both unlinking and zeroing the _defer, in addition to freeing it. Some history: prior to regabi, defer records contained their argument frame, which deferreturn copied to the stack before freeing the defer record (and subsequently running the defer). Since that argument frame didn't have a valid stack map until we ran the deferred function, the non-preemptible window was much larger and more difficult to isolate. Now we use normal closure calls to capture defer state and call the defer, so the non-preemptible window is narrowed to just the unlinking step. Change-Id: I7cf95ba18e1e2e7d73f616b9ed9fb38f5e725d72 Reviewed-on: https://go-review.googlesource.com/c/go/+/553696 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2024-01-22all: update vendored dependenciesCherry Mui
The Go 1.23 development tree has opened. This is a time to update all golang.org/x/... module versions that contribute packages to the std and cmd modules in the standard library to latest master versions. Generated with: go install golang.org/x/build/cmd/updatestd@latest go install golang.org/x/tools/cmd/bundle@latest updatestd -goroot=$(pwd) -branch=master For #36905. Change-Id: I46a68f27a54f1e3f9e1aa5af4de6ee0b26388f3f Reviewed-on: https://go-review.googlesource.com/c/go/+/557457 Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22doc/initial: initial contents of release notesJonathan Amsterdam
Add files to doc/initial that set up the overall structure of the release notes document. For #64169. Change-Id: Ifbf330e554e1fa20d47c72cc309d5cd26048a323 Reviewed-on: https://go-review.googlesource.com/c/go/+/556817 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2024-01-22cmd/compile: fix typo in commentRulin Tang
Change-Id: Ie3f1f194489dd4cfd995bfaf292e1c311b37597b GitHub-Last-Rev: 6a363297785187188923a76456b468ef1bc1a656 GitHub-Pull-Request: golang/go#65008 Reviewed-on: https://go-review.googlesource.com/c/go/+/554136 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Peter Weinberger <pjw@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Bypass: Robert Griesemer <gri@google.com>
2024-01-22doc/README.md: explain new release note systemJonathan Amsterdam
This is the first CL in a sequence that adds support for generating release notes from fragments. The actual generator will live elsewhere, in x/build. This repo will hold the content and some validity checks. For #64169. Change-Id: Iaa8d9ad96393ab9433170b3cfa47334837f3f691 Reviewed-on: https://go-review.googlesource.com/c/go/+/542515 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-01-22runtime: avoid loading winmm.dll on newer Windows versionsqmuntal
winmm.dll is only used for timeBeginPeriod and timeEndPeriod, which are not needed on Windows versions supporting high resolution timers, that is Windows 10 version 1803, and later. Updates #56745. Change-Id: Ie9576638fb8d2b4e648283bec3170aefa76f9f82 Reviewed-on: https://go-review.googlesource.com/c/go/+/556935 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2024-01-22cmd/compile/internal/ssa: fix typo in sccpWingrez
Change-Id: I7f522a4e1b0c50a469ce948249342d6e7cf7777c GitHub-Last-Rev: f89d7ee576814c6ebde823b68a0b64bba8c2ad8f GitHub-Pull-Request: golang/go#65188 Reviewed-on: https://go-review.googlesource.com/c/go/+/557255 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22doc/go1.22: fix method name in net/netip changesTobias Klauser
Change-Id: Icbeb911aad8bd23399b5afb66b3babed018368e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/556595 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Damien Neil <dneil@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2024-01-22doc: remove last TODO itemCarlos Amedee
For #61422 Change-Id: I50e427b78a533c3196aeb5291a34c05528ee0bed Reviewed-on: https://go-review.googlesource.com/c/go/+/557455 Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22net: attempt to deflake TestListenCloseListenBryan C. Mills
Also make it flakier in longtest mode by burning through more ephemeral ports. (Burning through the ports raised the failure rate for me locally enough to reliably reproduce the failure in #65175 with -count=10.) Fixes #65175 (I hope). Change-Id: I5f5b68b6bf6a6aa92e66f0288078817041656a3e Reviewed-on: https://go-review.googlesource.com/c/go/+/557177 Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22cmd/link,runtime: merge minfunc const info internal/abiqiulaidongfeng
For #59670 Change-Id: If2b05b1ba30b607b518577b0e11ba5a0b07999c5 GitHub-Last-Rev: a664aa18b5ef674dc2d05c1f7533e1974d265894 GitHub-Pull-Request: golang/go#64906 Reviewed-on: https://go-review.googlesource.com/c/go/+/553276 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2024-01-22net/http/pprof: configure WriteDeadlineAlexander Yastrebov
Configure write deadline according to requested profiling duration. Fixes #62358 Change-Id: I2350110ff20a637c7e90bdda57026b0b0d9c87ba GitHub-Last-Rev: b79ae38defc4d9b58b23a9d13ff86fa863f18b00 GitHub-Pull-Request: golang/go#64360 Reviewed-on: https://go-review.googlesource.com/c/go/+/544756 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22go/types, types2: typeparams.IndexExpr must not be an ast.ExprRob Findley
The typeparams.IndexExpr wrapper type was added as a compatibility layer to make the go/types code symmetric with types2. However, this type incidentally implemented the ast.Expr interface, leading to the accidental misuse that led to golang/go#63933. Fix this minimally for now, though leave a TODO that this old compatibility shim really needs to be eliminated. Also fix a case in types2 where operand.expr was set to a typed nil. Fixes golang/go#63933 Change-Id: I180d411e52f795a8322ecce6ed8649e88af1c63b Reviewed-on: https://go-review.googlesource.com/c/go/+/554395 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>