From c67ccdd98d90e45fb5c89118b155cbb9842797d0 Mon Sep 17 00:00:00 2001 From: john Date: Mon, 10 Sep 2018 18:01:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bgtype=E9=94=81=E6=9C=BA?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/container/gtype/gtype_atomic_test.go | 44 -------------------------- 1 file changed, 44 deletions(-) delete mode 100644 g/container/gtype/gtype_atomic_test.go diff --git a/g/container/gtype/gtype_atomic_test.go b/g/container/gtype/gtype_atomic_test.go deleted file mode 100644 index 89d63e379..000000000 --- a/g/container/gtype/gtype_atomic_test.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 gf Author(https://gitee.com/johng/gf). All Rights Reserved. -// -// This Source Code Form is subject to the terms of the MIT License. -// If a copy of the MIT was not distributed with this file, -// You can obtain one at https://gitee.com/johng/gf. - -// go test *.go -bench=".*" - -package gtype - -import ( - "testing" - "sync/atomic" -) - -var ( - gt = New() - at = atomic.Value{} -) - - -func Benchmark_GtypeSet(b *testing.B) { - for i := 0; i < b.N; i++ { - gt.Set(i) - } -} - -func Benchmark_GtypeVal(b *testing.B) { - for i := 0; i < b.N; i++ { - gt.Val() - } -} - -func BenchmarkInt_AtomicStore(b *testing.B) { - for i := 0; i < b.N; i++ { - at.Store(i) - } -} - -func BenchmarkInt32_AtomicLoad(b *testing.B) { - for i := int32(0); i < int32(b.N); i++ { - at.Load() - } -}