优化代码

This commit is contained in:
GoEdgeLab
2022-01-10 15:38:53 +08:00
parent 6007267d98
commit 1e718021db
2 changed files with 23 additions and 1 deletions

View File

@@ -165,3 +165,21 @@ func Benchmark_Map_Uint64(b *testing.B) {
}
}
}
func BenchmarkList_GC(b *testing.B) {
runtime.GOMAXPROCS(1)
var lists = []*List{}
for i := 0; i < 100; i++ {
lists = append(lists, NewList())
}
var timestamp = time.Now().Unix()
for i := 0; i < b.N; i++ {
for _, list := range lists {
list.GC(timestamp, nil)
}
}
}