some testing ang enchancments
This commit is contained in:
23
map_test.go
Normal file
23
map_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package extypes
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkHashMap_Add(b *testing.B) {
|
||||
b.StartTimer()
|
||||
m := make(HashMap[string, string])
|
||||
for i := 0; i < b.N; i++ {
|
||||
m.Add(fmt.Sprint(i), fmt.Sprint(i))
|
||||
}
|
||||
b.StopTimer()
|
||||
}
|
||||
func BenchmarkGoMap_Add(b *testing.B) {
|
||||
b.StartTimer()
|
||||
m := make(map[string]string)
|
||||
for i := 0; i < b.N; i++ {
|
||||
m[fmt.Sprint(i)] = fmt.Sprint(i)
|
||||
}
|
||||
b.StopTimer()
|
||||
}
|
||||
Reference in New Issue
Block a user