示例#1
0
func BenchmarkGoRemove(b *testing.B) {
	c := cow.New(m)
	for i := 0; i < b.N; i++ {
		go c.Remove("x")
		c.Remove("x")
	}
}
示例#2
0
func BenchmarkGoUpdate(b *testing.B) {
	c := cow.New(m)
	for i := 0; i < b.N; i++ {
		go c.Update(m)
		c.Update(m)
	}
}
示例#3
0
func BenchmarkGoInsert(b *testing.B) {
	c := cow.New(m)
	for i := 0; i < b.N; i++ {
		go c.Insert("a", "a")
		c.Insert("a", "a")
	}
}
示例#4
0
func BenchmarkGoRead(b *testing.B) {
	c := cow.New(m)
	for i := 0; i < b.N; i++ {
		go c.Get("a")
		c.Get("a")
	}
}
示例#5
0
func BenchmarkReset(b *testing.B) {
	c := cow.New(m)
	for i := 0; i < b.N; i++ {
		c.Reset(nil)
		c.Insert("a", "a")
	}
}
示例#6
0
func BenchmarkNew(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = cow.New(nil)
	}
}