go alg_test 源码
golang alg_test 代码
文件路径:/src/cmd/compile/internal/reflectdata/alg_test.go
// Copyright 2021 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 reflectdata_test
import "testing"
func BenchmarkEqArrayOfStrings5(b *testing.B) {
var a [5]string
var c [5]string
for i := 0; i < 5; i++ {
a[i] = "aaaa"
c[i] = "cccc"
}
for j := 0; j < b.N; j++ {
_ = a == c
}
}
func BenchmarkEqArrayOfStrings64(b *testing.B) {
var a [64]string
var c [64]string
for i := 0; i < 64; i++ {
a[i] = "aaaa"
c[i] = "cccc"
}
for j := 0; j < b.N; j++ {
_ = a == c
}
}
func BenchmarkEqArrayOfStrings1024(b *testing.B) {
var a [1024]string
var c [1024]string
for i := 0; i < 1024; i++ {
a[i] = "aaaa"
c[i] = "cccc"
}
for j := 0; j < b.N; j++ {
_ = a == c
}
}
func BenchmarkEqArrayOfFloats5(b *testing.B) {
var a [5]float32
var c [5]float32
for i := 0; i < b.N; i++ {
_ = a == c
}
}
func BenchmarkEqArrayOfFloats64(b *testing.B) {
var a [64]float32
var c [64]float32
for i := 0; i < b.N; i++ {
_ = a == c
}
}
func BenchmarkEqArrayOfFloats1024(b *testing.B) {
var a [1024]float32
var c [1024]float32
for i := 0; i < b.N; i++ {
_ = a == c
}
}
相关信息
相关文章
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦