1
0
mirror of https://github.com/golang/go synced 2024-11-25 02:47:58 -07:00
Commit Graph

60771 Commits

Author SHA1 Message Date
Tim King
ab4182251b cmd/internal/testdir: add a -gomodversion flag
Adds a -gomodversion flag to testdir. This sets the go version
in generated go.mod files. This is just runindir tests at the moment.
This is a building block so that tests can be written for exported
type parameterized aliases (like reproducing #68526).

This also adds a test that uses this feature. A type parameterized
alias is used so aliastypeparams and gotypesalias must be enabled.
gotypesalias is enabled by the go module version. The alias is not
exported and will not appear in exportdata. The test shows the
package containing the alias can be imported. This encapsulates
the level of support of type parameterized aliases in 1.23.

Updates #68526
Updates #68778

Change-Id: I8e20df6baa178e1d427d0fff627a16714d9c3b18
Reviewed-on: https://go-review.googlesource.com/c/go/+/604102
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
2024-08-20 17:17:59 +00:00
Dmitri Shuralyov
b292799ddd testing: use temp dir without symlinks in TestChdir/relative
When paths with symlinks are involved, it's not viable to compare them
with string equality. Don't use a temporary directory with symlinks in
it as input, so the test works in more environments.

For #62516.

Change-Id: I95d774365cc2f90eb0ffcffa61229ed5cee43e3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/607035
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-08-20 17:15:47 +00:00
Ian Lance Taylor
98ed865a9e doc/next: revert incorrect change to 62516.md made in CL 603959
Change-Id: I0d19f77f8c4b99350e3ed1e7f92db6ae198e812a
Reviewed-on: https://go-review.googlesource.com/c/go/+/607077
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-20 16:48:51 +00:00
apocelipes
819b1b4575 time: implement the encoding.(Binary|Text)Appender for Time
"Time.Marshal(Binary|Text)" could also gain some performance
improvements. Here is the benchmark highlight:

                │     old      │                 new                 │
                │    sec/op    │   sec/op     vs base                │
MarshalText-8     104.00n ± 3%   67.27n ± 2%  -35.32% (p=0.000 n=10)
MarshalBinary-8    31.77n ± 2%   12.13n ± 1%  -61.82% (p=0.000 n=10)
geomean            57.48n        28.57n       -50.30%

                │    old     │                  new                   │
                │    B/op    │   B/op     vs base                     │
MarshalText-8     48.00 ± 0%   0.00 ± 0%  -100.00% (p=0.000 n=10)
MarshalBinary-8   16.00 ± 0%   0.00 ± 0%  -100.00% (p=0.000 n=10)

                │    old     │                   new                   │
                │ allocs/op  │ allocs/op   vs base                     │
MarshalText-8     1.000 ± 0%   0.000 ± 0%  -100.00% (p=0.000 n=10)
MarshalBinary-8   1.000 ± 0%   0.000 ± 0%  -100.00% (p=0.000 n=10)

For #62384

Change-Id: I320421878a341abf8d668fd57b27292cdfa61330
GitHub-Last-Rev: e04f8df9c2
GitHub-Pull-Request: golang/go#68942
Reviewed-on: https://go-review.googlesource.com/c/go/+/606655
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-08-20 16:48:48 +00:00
Tim King
1a90dcdaaf go/types, types2: unalias tilde terms in underIs
Unalias the ~T terms during underIs. Before, if T was an alias
of U, it may pass T to the iteration function. The iterator
function expects an underlying type, under(U), to be passed.
This caused several bugs where underIs is used without
eventually taking the underlying type.

Updates #68935
Fixes #68903

Change-Id: Ie8691d8dddaea00e1dcba94d17c0f1b021fc49a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/606075
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-08-20 16:48:38 +00:00
Andy Pan
6fb6ace308 internal/poll: raise Linux's maxCopyFileRangeRound to MAX_RW_COUNT
Change-Id: I23c0c850ba57e7a49b78159d9293d1d25e1d2340
Reviewed-on: https://go-review.googlesource.com/c/go/+/606637
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
2024-08-20 16:39:43 +00:00
Oleksandr Redko
1fd8557249 time: fix godoc links; remove redundant Sub mention
The Time.Sub function is mentioned in the previous sentence.

Change-Id: Ic79958cea4d1f9f9014f6dafd8e749c204db4f50
Reviewed-on: https://go-review.googlesource.com/c/go/+/606575
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-08-20 16:10:45 +00:00
Kir Kolyshkin
60e9cf0f93 os: rm reiserfs exception from TestSeek
This exception was originally added by CL 152108 in November 2009. I'm
pretty sure no one uses reiserfs nowadays (and if someone does, this bug
must have been fixed by now).

Change-Id: I274ebe2f7910cab81b70a44b2da3f6fe761073bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/591417
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-08-20 16:09:42 +00:00
Kir Kolyshkin
5187baeb4e os: use t.TempDir in TestMkdirTemp, TestCreateTemp
This simplifies tests a little bit.

Change-Id: I910e3c97cfd20b26951d2a4909d86b5be06bde56
Reviewed-on: https://go-review.googlesource.com/c/go/+/606899
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-08-20 16:06:08 +00:00
Kir Kolyshkin
ef0b015407 os: use t.TempDir in TestReadOnlyWriteFile
This test is checking WriteFile, not MkdirTemp, and using t.TempDir
makes the test case code a tad smaller and simpler.

Change-Id: I48837f77572f375d56f3a387efa9a4ee1d3706fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/606898
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-20 16:06:05 +00:00
Kir Kolyshkin
4b767cf6fd os: simplify TestRemoveAllDot
Use t.Chdir and t.TempDir to simplify test case code.

Change-Id: If4de06d2373100ce53a5b8f6702d5f4866e3b23d
Reviewed-on: https://go-review.googlesource.com/c/go/+/606897
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-08-20 16:06:03 +00:00
Kir Kolyshkin
5164f61697 os: simplify TestRemoveAllLongPath
Simplify the test logic by using t.TempDir, t.Chdir, and Chdir to
startPath parent.

Change-Id: Ibe71a8c26b8e54c22eb93510037605b69c67bc7a
Reviewed-on: https://go-review.googlesource.com/c/go/+/606896
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-08-20 15:58:01 +00:00
Vladimir Varankin
f432b5f756 testing: add Context
Adds a new Context method to testing.T, that returns a context, that is
canceled before the end of its test function.

Fixes #36532.

Change-Id: I9315ad4dad25529d0b5be809e2d9db4e7528b5f2
GitHub-Last-Rev: 1c3fd6c4d8
GitHub-Pull-Request: golang/go#68828
Reviewed-on: https://go-review.googlesource.com/c/go/+/603959
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2024-08-20 14:58:54 +00:00
Joel Sing
c6c9634515 cmd/compile/internal/ssagen: factor out intrinsics code
The intrinsic handling code is a good thousand lines in the fairly
large ssa.go file. This code is already reasonably self-contained - factor
it out into a separate file so that future changes are easier to manage
(and it becomes easier to add/change intrinsics for an architecture).

Change-Id: I3c18d3d1bb6332f1817d902150e736373bf1ac81
Reviewed-on: https://go-review.googlesource.com/c/go/+/605477
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-08-20 14:20:34 +00:00
Joel Sing
b6f05cc333 cmd/compile/internal/ssagen: improve intrinsic architecture handling
The architecture handling code for intrinsics is more complex than
it needs to be. sys.Archs is already an array of *sys.Arch and the
existing InFamily function can be used instead of a reimplementation.

Add some test coverage for sys.Arch.InFamily while here.

Change-Id: Ia764f211114fea65424c09a421c5ccb02b7187b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/605476
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: 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-08-20 13:39:19 +00:00
Paul E. Murphy
d49d0e0d3a runtime: on AIX, fix call to _cgo_sys_thread_create in _rt0_ppc64_aix_lib
The AIX ABI requires allocating parameter save space when calling
a function, even if the arguments are passed via registers.

gcc sometimes uses this space. In the case of the cgo c-archive
tests, it clobbered the storage space of argc/argv which prevented
the test program from running the expected test.

Fixes #68957

Change-Id: I8a267b463b1abb2b37ac85231f6c328f406b7515
Reviewed-on: https://go-review.googlesource.com/c/go/+/606895
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2024-08-20 13:01:47 +00:00
Robert Griesemer
7fcd4a7007 internal/pkgbits: s/errorf/panicf/ because that's what it is
Make it obvious that this function panics.

Change-Id: I272142d2cf7132aa8915f8f4b5945834376db062
Reviewed-on: https://go-review.googlesource.com/c/go/+/606935
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-19 23:36:23 +00:00
Kir Kolyshkin
2e0a6f855b os.Getwd: wrap error on windows and plan9
The errors from os are supposed to be wrapped to add some context,
but in this particular case a raw syscall error is returned.

Change-Id: I1b98dbd7b385c5c1cea79a1b0ec7201ca9bdca40
Reviewed-on: https://go-review.googlesource.com/c/go/+/606657
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-08-19 21:44:08 +00:00
Paschalis T
d2b6bdb035 math/rand: make calls to Seed no-op
Makes calls to the global Seed a no-op. The GODEBUG=randseednop=0
setting can be used to revert this behavior.

Fixes #67273

Change-Id: I79c1b2b23f3bc472fbd6190cb916a9d7583250f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/606055
Auto-Submit: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-19 20:47:27 +00:00
Oleksandr Redko
d5f7da7987 all: remove duplicated words in comments
Change-Id: Id991ec0826a4e2857f00330b4b7ff2b71907b789
Reviewed-on: https://go-review.googlesource.com/c/go/+/606615
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
2024-08-19 19:09:04 +00:00
Rhys Hiltner
433c1d3b4a runtime: store zero-delay mutex contention events
Mutex contention events with delay of 0 need more than CL 604355 added:
When deciding which event to store in the M's single available slot,
always choose to drop the zero-delay event. Store an explicit flag for
whether we have an event to store, rather than relying on a non-zero
delay.

And, fix a test of sync.Mutex contention that expects those events to
have non-zero delay. The reporting of non-runtime contention like this
has long allowed zero-delay events, which we see when cputicks has low
resolution.

Fixes #68892
Fixes #68906

Change-Id: Id412141e4eb09724f3ce195899a20d59c92d7b78
Reviewed-on: https://go-review.googlesource.com/c/go/+/606115
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-08-19 15:50:50 +00:00
Joel Sing
3d9a89b057 cmd/compile: use integer min/max instructions on riscv64
When GORISCV64 enables rva22u64, make use of integer MIN/MINU/MAX/MAXU
instructions in compiler rewrite rules.

Change-Id: I4e7c514516acad03f2869d4c8936f06582cf7ea9
Reviewed-on: https://go-review.googlesource.com/c/go/+/559660
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
2024-08-19 13:46:02 +00:00
Conrad Irwin
27093581b2 cmd/mod/edit: add -tool and -droptool support
For golang/go#48429

Change-Id: I1a7bd8ffddbc65e3b687dc1d40f3853702e1b5dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/521958
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2024-08-17 03:03:34 +00:00
Gökhan Özeloğlu
0b23e477a2 strings: fix typo in examples
The correct word can be seen in lines 381-382.

Change-Id: If3876bd34b6433b69531763f63af88d60a0bfad0
Reviewed-on: https://go-review.googlesource.com/c/go/+/606375
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-08-16 23:50:48 +00:00
Kir Kolyshkin
79ca434ac6 testing: add Chdir
Some tests need to use os.Chdir, but the use is complicated because
 - they must change back to the old working directory;
 - they must not use t.Parallel.

Add Chdir that covers these cases, and sets PWD environment variable
to the new directory for the duration of the test for Unix platforms.
Unify the panic message when t.Parallel is used together with t.Setenv
or t.Chdir.

Add some tests.

For #62516.

Change-Id: Ib050d173b26eb28a27dba5a206b2d0d877d761c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/529895
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-08-16 23:48:50 +00:00
doujiang24
ff271cd391 cmd/cgo: enable #cgo noescape/nocallback
In Go 1.22 we added code to the go/build package to ignore #cgo noescape
and nocallback directives. That permits us to enable these directives in Go 1.24.

Also, this fixed a Bug in CL 497837:
After retiring _Cgo_use for parameters, the compiler will treat the
parameters, start from the second, as non-alive. Then, they will be marked
as scalar in stackmap, which means the pointer won't be copied correctly
in copystack.

Fixes #56378.
Fixes #63739.

Change-Id: I46e773240f8a467c3c4ba201dc5b4ee473cf6e3e
GitHub-Last-Rev: 42fcc506d6
GitHub-Pull-Request: golang/go#66879
Reviewed-on: https://go-review.googlesource.com/c/go/+/579955
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-16 23:44:54 +00:00
Andy Pan
96ef6abcca os: only employ sendfile(3ext) on illumos when target is regular file
Follows up CL 605355
Fixes #68863

Change-Id: I56e05822502e66eed610d5e924d110607ce146b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/606135
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
2024-08-16 23:34:45 +00:00
Andy Pan
aa5d672a00 os: use O_EXCL instead of O_TRUNC in CopyFS to disallow rewriting existing files
On Linux, a call to creat() is equivalent to calling open() with flags
equal to O_CREAT|O_WRONLY|O_TRUNC, which applies to other platforms
as well in a similar manner. Thus, to force CopyFS's behavior to
comply with the function comment, we need to replace O_TRUNC with O_EXCL.

Fixes #68895

Change-Id: I3e2ab153609d3c8cf20ce5969d6f3ef593833cd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/606095
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-08-16 23:34:41 +00:00
Tim King
660e7d60f2 go/internal/gcimporter: indexed format imports for type parameters aliases
Add support for importing a new 'B' tag for type parameters aliases
in the indexed data format.

Updates #68778

Change-Id: I3bd82870d4c4619a3771de30baf6d54f6ee5959e
Reviewed-on: https://go-review.googlesource.com/c/go/+/604635
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2024-08-16 22:38:15 +00:00
zhangyunhao
0320616db9 runtime: use .Pointers() instead of .PtrBytes != 0
Change-Id: I512808d3cf91466eb6f2c21b49b39ff2e08a9b8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/605498
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2024-08-16 14:47:36 +00:00
Robert Griesemer
818515fd3e go/types, types2: Named.cleanup must also handle *Alias types
Named.cleanup is called at the end of type-checking to ensure that
a named type is fully set up; specifically that it's underlying
field is not (still) a Named type. Now it can also be an *Alias
type. Add this case to the respective type switch.

Fixes #68877.

Change-Id: I29bc0024ac9d8b0152a3d97c82dd28d09d5dbd66
Reviewed-on: https://go-review.googlesource.com/c/go/+/605977
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-16 13:54:51 +00:00
apocelipes
527610763b math/big,regexp: implement the encoding.TextAppender interface
For #62384

Change-Id: I1557704c6a0f9c6f3b9aad001374dd5cdbc99065
GitHub-Last-Rev: c258d18cce
GitHub-Pull-Request: golang/go#68893
Reviewed-on: https://go-review.googlesource.com/c/go/+/605758
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2024-08-15 23:43:00 +00:00
j2gg0s
bd8977be0c encoding/json: merge FieldStack if the error's Field exists.
When people return UnmarshalTypeError in UnmarshalJSON, we should append error's Field to FieldStack.

Fixes #68750

Change-Id: I0a5a9b259a1b569de1bebc815ec936c913e10469
GitHub-Last-Rev: 18796addc3
GitHub-Pull-Request: golang/go#68870
Reviewed-on: https://go-review.googlesource.com/c/go/+/605455
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-15 20:28:20 +00:00
Andy Pan
970b1c042c os: increase the amount of data transfer for sendfile(2) to reduce syscalls
For the moment, Go calls sendfile(2) to transfer at most 4MB at a time
while sendfile(2) actually allows a larger amount of data on one call.
To reduce system calls of sendfile(2) during data copying, we should
specify the number of bytes to copy as large as possible.

This optimization is especially advantageous for bulky file-to-file copies,
it would lead to a performance boost, the magnitude of this performance
increase may not be very exciting, but it can also cut down the CPU overhead
by decreasing the number of system calls.

This is also how we've done in sendfile_windows.go with TransmitFile.

goos: linux
goarch: amd64
pkg: os
cpu: DO-Premium-AMD
           │    old     │                new                │
           │   sec/op   │   sec/op    vs base               │
SendFile-8   1.135 ± 4%   1.052 ± 3%  -7.24% (p=0.000 n=10)

           │     old      │                 new                 │
           │     B/s      │     B/s       vs base               │
SendFile-8   902.5Mi ± 4%   973.0Mi ± 3%  +7.81% (p=0.000 n=10)

           │    old     │              new               │
           │    B/op    │    B/op     vs base            │
SendFile-8   272.0 ± 0%   272.0 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

           │    old     │              new               │
           │ allocs/op  │ allocs/op   vs base            │
SendFile-8   20.00 ± 0%   20.00 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

Change-Id: Ib4d4c6bc693e23db24697363b29226f0c9776bb0
Reviewed-on: https://go-review.googlesource.com/c/go/+/605235
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-08-15 20:21:47 +00:00
apocelipes
dc5389d859 crypto,hash: add t.Helper calls to test helpers
Use t.Helper to make the reported failure lines more helpful.

Change-Id: I6593924b3892b2441a197aee4e05f71ea236d426
GitHub-Last-Rev: 2e020ea85c
GitHub-Pull-Request: golang/go#68843
Reviewed-on: https://go-review.googlesource.com/c/go/+/604755
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-15 20:19:52 +00:00
Tim King
209ed1a9c7 cmd/compile/internal/importer: enable aliases
Flips the pkgReader.enableAlias flag to true when reading unified IR.
This was disabled while resolving #66873. This resolves the TODO to
flip it back to true.

Updates #66873
Updates #68778

Change-Id: Ifd52b0f9510d6bcf151de1c9a18d71ab548c14e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/604099
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2024-08-15 20:16:34 +00:00
Andy Pan
f7cdadafbe internal,os: employ copy_file_range(2) for file-to-file copying on FreeBSD
FreeBSD 13.0 introduced the Linux-compatible copy_file_range(2) system call,
we should make use of it.

Ref:
https://www.gnu.org/software/gnulib/manual/html_node/copy_005ffile_005frange.html
https://reviews.freebsd.org/D20584?id=60021
https://man.freebsd.org/cgi/man.cgi?copy_file_range(2)

Change-Id: I75edb5629717289c8887be436613d3a8b3820bdc
Reviewed-on: https://go-review.googlesource.com/c/go/+/604655
Run-TryBot: Andy Pan <panjf2000@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-08-15 19:23:02 +00:00
Michael Matloob
2693f77b35 Revert "go/types, types2: only use fileVersion if 1.21 or greater"
This reverts CL 603895

Reason for revert: We've decided to change the logic for how upgrades are done and want to submit the new logic in a self contained CL that can be cherry-picked onto release-branch.go1.23

Change-Id: I366af8e95ce1de7311b0385a23f9dd3df175745a
Reviewed-on: https://go-review.googlesource.com/c/go/+/605675
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-15 14:43:25 +00:00
Joel Sing
1419d0e925 math/big: implement subVV in riscv64 assembly
This provides an assembly implementation of subVV for riscv64,
processing up to four words per loop, resulting in a significant
performance gain.

On a StarFive VisionFive 2:

               │   subvv.1    │               subvv.2               │
               │    sec/op    │   sec/op     vs base                │
SubVV/1-4         73.46n ± 0%   48.08n ± 0%  -34.55% (p=0.000 n=10)
SubVV/2-4         88.13n ± 0%   58.76n ± 0%  -33.33% (p=0.000 n=10)
SubVV/3-4        102.80n ± 0%   69.45n ± 0%  -32.44% (p=0.000 n=10)
SubVV/4-4        117.50n ± 0%   72.11n ± 0%  -38.63% (p=0.000 n=10)
SubVV/5-4        132.20n ± 0%   82.80n ± 0%  -37.37% (p=0.000 n=10)
SubVV/10-4        216.3n ± 0%   126.9n ± 0%  -41.33% (p=0.000 n=10)
SubVV/100-4      1659.0n ± 0%   886.5n ± 0%  -46.56% (p=0.000 n=10)
SubVV/1000-4     16.089µ ± 0%   8.401µ ± 0%  -47.78% (p=0.000 n=10)
SubVV/10000-4     244.7µ ± 0%   176.8µ ± 0%  -27.74% (p=0.000 n=10)
SubVV/100000-4    2.562m ± 0%   1.871m ± 0%  -26.96% (p=0.000 n=10)
geomean           1.436µ        904.4n       -37.04%

               │   subvv.1    │                subvv.2                │
               │     B/s      │      B/s       vs base                │
SubVV/1-4        830.9Mi ± 0%   1269.5Mi ± 0%  +52.79% (p=0.000 n=10)
SubVV/2-4        1.353Gi ± 0%    2.029Gi ± 0%  +49.99% (p=0.000 n=10)
SubVV/3-4        1.739Gi ± 0%    2.575Gi ± 0%  +48.06% (p=0.000 n=10)
SubVV/4-4        2.029Gi ± 0%    3.306Gi ± 0%  +62.96% (p=0.000 n=10)
SubVV/5-4        2.254Gi ± 0%    3.600Gi ± 0%  +59.67% (p=0.000 n=10)
SubVV/10-4       2.755Gi ± 0%    4.699Gi ± 0%  +70.53% (p=0.000 n=10)
SubVV/100-4      3.594Gi ± 0%    6.723Gi ± 0%  +87.08% (p=0.000 n=10)
SubVV/1000-4     3.705Gi ± 0%    7.095Gi ± 0%  +91.52% (p=0.000 n=10)
SubVV/10000-4    2.436Gi ± 0%    3.372Gi ± 0%  +38.39% (p=0.000 n=10)
SubVV/100000-4   2.327Gi ± 0%    3.185Gi ± 0%  +36.91% (p=0.000 n=10)
geomean          2.118Gi         3.364Gi       +58.84%

Change-Id: I361cb3f4195b27a9f1e9486c9e1fdbeaa94d32b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/595396
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-08-15 12:06:59 +00:00
limeidan
49adb8e460 cmd/internal/obj/loong64: add testcases for assembler
Change-Id: Ib2c8e0bc314c0f2b58f69a5340355cac4786a91f
Reviewed-on: https://go-review.googlesource.com/c/go/+/604175
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-15 00:52:05 +00:00
Dmitri Shuralyov
370a6959e3 cmd/dist, internal/platform: mark windows/arm (32-bit ARM) broken
The port is reportedly broken, and there isn't a builder testing it.

For #68552.
For #67308.

Change-Id: Iababa17cdf855b675aaf85642a667e8081ef5dfe
Reviewed-on: https://go-review.googlesource.com/c/go/+/601777
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2024-08-14 20:56:33 +00:00
Andy Pan
866e260f92 os: only employ sendfile(3ext) on illumos when target is regular file
Fixes #68863

Change-Id: I0ca324137d1f7510bd0b245791fef07d3b5b401a
Reviewed-on: https://go-review.googlesource.com/c/go/+/605355
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-08-14 18:36:17 +00:00
Rhys Hiltner
1416cebdd5 runtime: record all sampled mutex profile events
The block and mutex profiles have slightly different behaviors when a
sampled event has a negative (or zero) duration. The block profile
enforces a minimum duration for each event of "1" in the cputicks unit.
It does so by clamping the duration to 1 if it was originally reported
as being smaller. The mutex profile for app-level contention enforces a
minimum duration of 0 in a similar way: by reporting any negative values
as 0 instead.

The mutex profile for runtime-internal contention had a different
behavior: to enforce a minimum event duration of "1" by dropping any
non-conforming samples.

Stop dropping samples, and use the same minimum (0) that's in place for
the other mutex profile events.

Fixes #64253
Fixes #68453
Fixes #68781

Change-Id: I4c5d23a2675501226eef5b9bc1ada2efc1a55b9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/604355
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
2024-08-14 18:33:40 +00:00
cuishuang
0f1db95414 maps, slices: fix variable name and comment in example
Change-Id: I1c837820bdd64b61fca46d45677664b2bb2be606
Reviewed-on: https://go-review.googlesource.com/c/go/+/605356
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-08-14 18:28:34 +00:00
Charlie Vieth
65a6e05070 byte,strings: improve IndexRune performance by ~45%
Change IndexRune to search for the last byte of a multi-byte rune
instead of using the first byte. This improves search performance
by 45% on average when dealing with Unicode text.

The rationale here is that the last byte of a UTF-8 encoded multi-byte
rune is significantly more unique (evenly distributed) than the first
byte which has a 78% chance of being [240, 243, 244].

This approach is typically much faster, but can be slower when there
are a large number of false positives (see Han benchmarks) because
the more even distribution of bytes can delay/prevent falling back
to a brute-force search using bytealg.Index, which is particularly
powerful on amd64/x86_64 (particularly Skylake, but less so with
newer processors).

bytes package benchmarks:

goos: darwin
goarch: arm64
pkg: bytes
cpu: Apple M1 Max
                                 │ base.10.txt  │             new.10.txt              │
                                 │    sec/op    │   sec/op     vs base                │
IndexRune/10-10                     9.784n ± 0%   8.470n ± 0%  -13.43% (p=0.000 n=10)
IndexRune/32-10                    11.660n ± 0%   8.473n ± 0%  -27.34% (p=0.000 n=10)
IndexRune/4K-10                     83.96n ± 0%   81.08n ± 0%   -3.44% (p=0.000 n=10)
IndexRune/4M-10                     63.92µ ± 0%   64.67µ ± 0%   +1.17% (p=0.000 n=10)
IndexRune/64M-10                    1.121m ± 1%   1.125m ± 1%        ~ (p=0.218 n=10)
IndexRuneUnicode/Latin/10-10       10.125n ± 0%   7.347n ± 0%  -27.43% (p=0.000 n=10)
IndexRuneUnicode/Latin/32-10       11.435n ± 0%   7.349n ± 0%  -35.73% (p=0.000 n=10)
IndexRuneUnicode/Latin/4K-10        882.6n ± 0%   334.9n ± 1%  -62.06% (p=0.000 n=10)
IndexRuneUnicode/Latin/4M-10        977.2µ ± 0%   370.9µ ± 1%  -62.04% (p=0.000 n=10)
IndexRuneUnicode/Latin/64M-10      15.649m ± 1%   6.028m ± 1%  -61.48% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/10-10    10.070n ± 0%   8.701n ± 0%  -13.59% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/32-10    19.045n ± 0%   8.704n ± 1%  -54.30% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/4K-10     2.734µ ± 0%   1.046µ ± 1%  -61.75% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/4M-10     2.671m ± 0%   1.143m ± 1%  -57.22% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/64M-10    43.12m ± 1%   18.26m ± 1%  -57.64% (p=0.000 n=10)
IndexRuneUnicode/Han/10-10          10.10n ± 0%   10.82n ± 1%   +7.08% (p=0.000 n=10)
IndexRuneUnicode/Han/32-10          38.29n ± 1%   10.87n ± 1%  -71.62% (p=0.000 n=10)
IndexRuneUnicode/Han/4K-10         1409.0n ± 0%   489.1n ± 1%  -65.28% (p=0.000 n=10)
IndexRuneUnicode/Han/4M-10         1338.4µ ± 0%   821.1µ ± 2%  -38.65% (p=0.000 n=10)
IndexRuneUnicode/Han/64M-10         21.42m ± 1%   13.42m ± 2%  -37.34% (p=0.000 n=10)
geomean                             3.983µ        2.305µ       -42.14%

                                 │ base.10.txt  │               new.10.txt               │
                                 │     B/s      │      B/s       vs base                 │
IndexRune/10-10                    974.8Mi ± 0%   1126.1Mi ± 0%   +15.52% (p=0.000 n=10)
IndexRune/32-10                    2.556Gi ± 0%    3.517Gi ± 0%   +37.62% (p=0.000 n=10)
IndexRune/4K-10                    45.43Gi ± 0%    47.05Gi ± 0%    +3.56% (p=0.000 n=10)
IndexRune/4M-10                    61.12Gi ± 0%    60.41Gi ± 0%    -1.16% (p=0.000 n=10)
IndexRune/64M-10                   55.74Gi ± 1%    55.57Gi ± 1%         ~ (p=0.218 n=10)
IndexRuneUnicode/Latin/10-10       942.0Mi ± 0%   1297.9Mi ± 0%   +37.78% (p=0.000 n=10)
IndexRuneUnicode/Latin/32-10       2.606Gi ± 0%    4.055Gi ± 0%   +55.61% (p=0.000 n=10)
IndexRuneUnicode/Latin/4K-10       4.322Gi ± 0%   11.392Gi ± 1%  +163.57% (p=0.000 n=10)
IndexRuneUnicode/Latin/4M-10       3.998Gi ± 0%   10.532Gi ± 1%  +163.47% (p=0.000 n=10)
IndexRuneUnicode/Latin/64M-10      3.994Gi ± 1%   10.369Gi ± 1%  +159.61% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/10-10    947.2Mi ± 0%   1096.1Mi ± 0%   +15.72% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/32-10    1.565Gi ± 0%    3.424Gi ± 1%  +118.80% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/4K-10    1.396Gi ± 0%    3.649Gi ± 1%  +161.43% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/4M-10    1.462Gi ± 0%    3.418Gi ± 1%  +133.76% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/64M-10   1.450Gi ± 1%    3.422Gi ± 1%  +136.08% (p=0.000 n=10)
IndexRuneUnicode/Han/10-10         944.6Mi ± 0%    881.7Mi ± 1%    -6.66% (p=0.000 n=10)
IndexRuneUnicode/Han/32-10         797.0Mi ± 1%   2809.3Mi ± 1%  +252.47% (p=0.000 n=10)
IndexRuneUnicode/Han/4K-10         2.707Gi ± 0%    7.798Gi ± 1%  +188.04% (p=0.000 n=10)
IndexRuneUnicode/Han/4M-10         2.919Gi ± 0%    4.757Gi ± 2%   +63.01% (p=0.000 n=10)
IndexRuneUnicode/Han/64M-10        2.917Gi ± 1%    4.656Gi ± 2%   +59.60% (p=0.000 n=10)
geomean                            3.036Gi         5.246Gi        +72.82%

goos: linux
goarch: amd64
pkg: bytes
                                │   old.txt    │                new.txt                │
                                │    sec/op    │    sec/op      vs base                │
IndexRune/10-4                    10.805n ± 0%    6.999n ±  0%  -35.22% (p=0.000 n=10)
IndexRune/32-4                    12.515n ± 0%    7.539n ±  0%  -39.76% (p=0.000 n=10)
IndexRune/4K-4                     71.69n ± 0%    68.39n ±  0%   -4.60% (p=0.000 n=10)
IndexRune/4M-4                    125.19µ ± 2%    63.05µ ±  0%  -49.63% (p=0.000 n=10)
IndexRune/64M-4                    1.050m ± 1%    1.053m ±  0%        ~ (p=0.353 n=10)
IndexRuneUnicode/Latin/10-4        9.471n ± 0%    6.144n ±  1%  -35.13% (p=0.000 n=10)
IndexRuneUnicode/Latin/32-4       12.540n ± 0%    6.655n ±  0%  -46.93% (p=0.000 n=10)
IndexRuneUnicode/Latin/4K-4        522.1n ± 0%    207.2n ±  0%  -60.32% (p=0.000 n=10)
IndexRuneUnicode/Latin/4M-4        626.1µ ± 0%    297.2µ ±  0%  -52.54% (p=0.000 n=10)
IndexRuneUnicode/Latin/64M-4      13.866m ± 3%    5.069m ±  4%  -63.44% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/10-4    10.920n ± 0%    7.213n ±  0%  -33.95% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/32-4    12.515n ± 0%    7.780n ±  0%  -37.83% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/4K-4    2650.0n ± 0%    621.5n ±  0%  -76.55% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/4M-4    2744.7µ ± 0%    723.2µ ±  0%  -73.65% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/64M-4    44.18m ± 0%    14.22m ± 14%  -67.82% (p=0.000 n=10)
IndexRuneUnicode/Han/10-4         10.795n ± 0%    9.734n ±  1%   -9.83% (p=0.000 n=10)
IndexRuneUnicode/Han/32-4          12.79n ± 0%    10.42n ±  1%  -18.46% (p=0.000 n=10)
IndexRuneUnicode/Han/4K-4          519.7n ± 0%    288.4n ±  0%  -44.51% (p=0.000 n=10)
IndexRuneUnicode/Han/4M-4          498.2µ ± 0%    443.0µ ±  0%  -11.07% (p=0.000 n=10)
IndexRuneUnicode/Han/64M-4         9.654m ± 2%   12.223m ±  1%  +26.61% (p=0.000 n=10)
geomean                            3.168µ         1.828µ        -42.30%

                                │    old.txt    │                 new.txt                 │
                                │      B/s      │      B/s        vs base                 │
IndexRune/10-4                     882.5Mi ± 0%   1362.6Mi ±  0%   +54.41% (p=0.000 n=10)
IndexRune/32-4                     2.381Gi ± 0%    3.953Gi ±  0%   +66.00% (p=0.000 n=10)
IndexRune/4K-4                     53.21Gi ± 0%    55.77Gi ±  0%    +4.82% (p=0.000 n=10)
IndexRune/4M-4                     31.20Gi ± 2%    61.95Gi ±  0%   +98.55% (p=0.000 n=10)
IndexRune/64M-4                    59.54Gi ± 1%    59.37Gi ±  0%         ~ (p=0.353 n=10)
IndexRuneUnicode/Latin/10-4       1006.9Mi ± 0%   1552.3Mi ±  1%   +54.17% (p=0.000 n=10)
IndexRuneUnicode/Latin/32-4        2.376Gi ± 0%    4.478Gi ±  0%   +88.45% (p=0.000 n=10)
IndexRuneUnicode/Latin/4K-4        7.306Gi ± 0%   18.411Gi ±  0%  +152.01% (p=0.000 n=10)
IndexRuneUnicode/Latin/4M-4        6.239Gi ± 0%   13.145Gi ±  0%  +110.70% (p=0.000 n=10)
IndexRuneUnicode/Latin/64M-4       4.507Gi ± 3%   12.329Gi ±  4%  +173.54% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/10-4     873.0Mi ± 0%   1322.2Mi ±  0%   +51.46% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/32-4     2.382Gi ± 0%    3.831Gi ±  0%   +60.84% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/4K-4     1.439Gi ± 0%    6.138Gi ±  0%  +326.43% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/4M-4     1.423Gi ± 0%    5.401Gi ±  0%  +279.52% (p=0.000 n=10)
IndexRuneUnicode/Cyrillic/64M-4    1.415Gi ± 0%    4.396Gi ± 17%  +210.79% (p=0.000 n=10)
IndexRuneUnicode/Han/10-4          883.4Mi ± 0%    979.7Mi ±  1%   +10.90% (p=0.000 n=10)
IndexRuneUnicode/Han/32-4          2.331Gi ± 0%    2.858Gi ±  1%   +22.61% (p=0.000 n=10)
IndexRuneUnicode/Han/4K-4          7.340Gi ± 0%   13.226Gi ±  0%   +80.19% (p=0.000 n=10)
IndexRuneUnicode/Han/4M-4          7.841Gi ± 0%    8.817Gi ±  0%   +12.44% (p=0.000 n=10)
IndexRuneUnicode/Han/64M-4         6.474Gi ± 2%    5.113Gi ±  1%   -21.02% (p=0.000 n=10)
geomean                            3.816Gi         6.614Gi         +73.32%

strings package benchmarks:

goos: darwin
goarch: arm64
pkg: strings
                       │ base.index_rune.10.txt │        new.index_rune.10.txt        │
                       │         sec/op         │   sec/op     vs base                │
IndexRune-10                       11.905n ± 5%   6.633n ± 6%  -44.28% (p=0.000 n=10)
IndexRuneLongString-10             13.800n ± 1%   7.330n ± 2%  -46.88% (p=0.000 n=10)
IndexRuneFastPath-10                3.477n ± 0%   3.481n ± 1%        ~ (p=0.468 n=10)
geomean                             8.297n        5.531n       -33.34%

Change-Id: I59357fda1c8ac85315b759930f620dbce1ba4721
Reviewed-on: https://go-review.googlesource.com/c/go/+/539116
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-08-14 18:25:29 +00:00
aimuz
9becf401de bytes, strings: add Lines, SplitSeq, SplitAfterSeq, FieldsSeq, FieldsFuncSeq
Fixes #61901.

Change-Id: I4db21c91fd21079f2aa3bc81fb03dd6f40423a38
GitHub-Last-Rev: ed3df560a4
GitHub-Pull-Request: golang/go#67543
Reviewed-on: https://go-review.googlesource.com/c/go/+/587095
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-08-14 18:23:13 +00:00
Sebastian Nickolls
3e3ce20df8 cmd/internal/obj/arm64: Emit UDF instruction for undefined Prog nodes
UDF provides a stronger guarantee for generating the Undefined
Instruction exception than the current value being emitted.

Change-Id: I234cd70ce04f21311959c1061ae24992438105f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/605155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-08-14 18:19:53 +00:00
Keith Randall
b2cdaf7346 cmd/compile: improve unneeded zeroing removal
After newobject, we don't need to write zeroes to initialize the
object.  It has already been zeroed by the allocator.

This is already handled in most cases, but because we run builtin
decomposition after the opt pass, we don't handle cases where the zero
of a compound builtin is being written. Improve the zero detector to
handle those cases.

Fixes #68845

Change-Id: If3dde2e304a05e5a6a6723565191d5444b334bcc
Reviewed-on: https://go-review.googlesource.com/c/go/+/605255
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-08-14 18:16:29 +00:00
guoguangwu
8b32ce586d net/http/httputil: close res body in test
Change-Id: Ic57c93a8d8413fe4985bc430255b6db90e11b70c
GitHub-Last-Rev: 25db6644c6
GitHub-Pull-Request: golang/go#68397
Reviewed-on: https://go-review.googlesource.com/c/go/+/597936
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2024-08-14 18:15:48 +00:00
Jaeho Nam
d3c82937e9 crypto/tls: fix typo in quicError
Change-Id: I2c07592c3b896bc86e349de7c032929b9979349c
GitHub-Last-Rev: 0fe8b90e09
GitHub-Pull-Request: golang/go#68757
Reviewed-on: https://go-review.googlesource.com/c/go/+/603517
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-08-14 18:08:03 +00:00