mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-10 03:40:24 +08:00
优化代码
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user