mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
name old time/op new time/op delta LoadAdd-16 545ns ± 0% 456ns ± 0% -16.31% (p=0.000 n=10+10) Update #36468 Change-Id: I84f390d55490648fa1f58cdbc24fd74c4f1bc8c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/227960 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
21 lines
401 B
Go
21 lines
401 B
Go
// Copyright 2020 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package gc
|
|
|
|
import "testing"
|
|
|
|
var globl int64
|
|
|
|
func BenchmarkLoadAdd(b *testing.B) {
|
|
x := make([]int64, 1024)
|
|
y := make([]int64, 1024)
|
|
for i := 0; i < b.N; i++ {
|
|
var s int64
|
|
for i := range x {
|
|
s ^= x[i] + y[i]
|
|
}
|
|
globl = s
|
|
}
|
|
}
|