完善gtype性能测试

This commit is contained in:
John
2018-03-28 10:46:19 +08:00
parent 36b9f06062
commit d89e7183c5
2 changed files with 20 additions and 20 deletions

View File

@ -4,31 +4,31 @@ john@johnstation:~/Workspace/Go/GOPATH/src/gitee.com/johng/gf/g/container/gtype$
goos: linux
goarch: amd64
BenchmarkInt_Set-8 300000000 5.65 ns/op
BenchmarkInt_Get-8 2000000000 0.35 ns/op
BenchmarkInt_Val-8 2000000000 0.35 ns/op
BenchmarkInt_Add-8 300000000 5.68 ns/op
BenchmarkInt32_Set-8 300000000 5.67 ns/op
BenchmarkInt32_Get-8 2000000000 0.36 ns/op
BenchmarkInt32_Val-8 2000000000 0.36 ns/op
BenchmarkInt32_Add-8 300000000 5.68 ns/op
BenchmarkInt64_Set-8 300000000 5.66 ns/op
BenchmarkInt64_Get-8 2000000000 0.35 ns/op
BenchmarkInt64_Val-8 2000000000 0.35 ns/op
BenchmarkInt64_Add-8 300000000 5.67 ns/op
BenchmarkUint_Set-8 300000000 5.68 ns/op
BenchmarkUint_Get-8 2000000000 0.34 ns/op
BenchmarkUint_Val-8 2000000000 0.34 ns/op
BenchmarkUint_Add-8 300000000 5.68 ns/op
BenchmarkUint32_Set-8 300000000 5.65 ns/op
BenchmarkUint32_Get-8 2000000000 0.34 ns/op
BenchmarkUint32_Val-8 2000000000 0.34 ns/op
BenchmarkUint32_Add-8 300000000 5.66 ns/op
BenchmarkUint64_Set-8 300000000 5.68 ns/op
BenchmarkUint64_Get-8 2000000000 0.34 ns/op
BenchmarkUint64_Val-8 2000000000 0.34 ns/op
BenchmarkUint64_Add-8 300000000 5.68 ns/op
BenchmarkBool_Set-8 300000000 5.67 ns/op
BenchmarkBool_Get-8 2000000000 0.34 ns/op
BenchmarkBool_Val-8 2000000000 0.34 ns/op
BenchmarkString_Set-8 30000000 48.5 ns/op
BenchmarkString_Get-8 100000000 12.3 ns/op
BenchmarkString_Val-8 100000000 12.3 ns/op
BenchmarkBytes_Set-8 50000000 34.9 ns/op
BenchmarkBytes_Get-8 100000000 12.5 ns/op
BenchmarkBytes_Val-8 100000000 12.5 ns/op
BenchmarkInterface_Set-8 50000000 34.2 ns/op
BenchmarkInterface_Get-8 100000000 12.2 ns/op
BenchmarkInterface_Val-8 100000000 12.2 ns/op
PASS
ok command-line-arguments 43.447s
```

View File

@ -32,7 +32,7 @@ func BenchmarkInt_Set(b *testing.B) {
}
}
func BenchmarkInt_Get(b *testing.B) {
func BenchmarkInt_Val(b *testing.B) {
for i := 0; i < b.N; i++ {
it.Val()
}
@ -50,7 +50,7 @@ func BenchmarkInt32_Set(b *testing.B) {
}
}
func BenchmarkInt32_Get(b *testing.B) {
func BenchmarkInt32_Val(b *testing.B) {
for i := int32(0); i < int32(b.N); i++ {
it32.Val()
}
@ -68,7 +68,7 @@ func BenchmarkInt64_Set(b *testing.B) {
}
}
func BenchmarkInt64_Get(b *testing.B) {
func BenchmarkInt64_Val(b *testing.B) {
for i := int64(0); i < int64(b.N); i++ {
it64.Val()
}
@ -88,7 +88,7 @@ func BenchmarkUint_Set(b *testing.B) {
}
}
func BenchmarkUint_Get(b *testing.B) {
func BenchmarkUint_Val(b *testing.B) {
for i := uint(0); i < uint(b.N); i++ {
uit.Val()
}
@ -108,7 +108,7 @@ func BenchmarkUint32_Set(b *testing.B) {
}
}
func BenchmarkUint32_Get(b *testing.B) {
func BenchmarkUint32_Val(b *testing.B) {
for i := uint32(0); i < uint32(b.N); i++ {
uit32.Val()
}
@ -127,7 +127,7 @@ func BenchmarkUint64_Set(b *testing.B) {
}
}
func BenchmarkUint64_Get(b *testing.B) {
func BenchmarkUint64_Val(b *testing.B) {
for i := uint64(0); i < uint64(b.N); i++ {
uit64.Val()
}
@ -147,7 +147,7 @@ func BenchmarkBool_Set(b *testing.B) {
}
}
func BenchmarkBool_Get(b *testing.B) {
func BenchmarkBool_Val(b *testing.B) {
for i := 0; i < b.N; i++ {
bl.Val()
}
@ -161,7 +161,7 @@ func BenchmarkString_Set(b *testing.B) {
}
}
func BenchmarkString_Get(b *testing.B) {
func BenchmarkString_Val(b *testing.B) {
for i := 0; i < b.N; i++ {
str.Val()
}
@ -175,7 +175,7 @@ func BenchmarkBytes_Set(b *testing.B) {
}
}
func BenchmarkBytes_Get(b *testing.B) {
func BenchmarkBytes_Val(b *testing.B) {
for i := 0; i < b.N; i++ {
bytes.Val()
}
@ -188,7 +188,7 @@ func BenchmarkInterface_Set(b *testing.B) {
}
}
func BenchmarkInterface_Get(b *testing.B) {
func BenchmarkInterface_Val(b *testing.B) {
for i := 0; i < b.N; i++ {
inf.Val()
}