Files
gf/g/os/gcache/gcache_test.go

33 lines
683 B
Go
Raw Normal View History

2018-02-12 15:33:19 +08:00
// Copyright 2017 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 gcache
2018-02-12 15:33:19 +08:00
import (
"testing"
"strconv"
)
func BenchmarkSet(b *testing.B) {
for i := 0; i < b.N; i++ {
Set(strconv.Itoa(i), strconv.Itoa(i), 0)
2018-02-12 15:33:19 +08:00
}
}
func BenchmarkGet(b *testing.B) {
for i := 0; i < b.N; i++ {
Get(strconv.Itoa(i))
2018-02-12 15:33:19 +08:00
}
}
func BenchmarkRemove(b *testing.B) {
for i := 0; i < b.N; i++ {
Remove(strconv.Itoa(i))
2018-02-12 15:33:19 +08:00
}
}