github.com/rehtt/go-map@v0.0.0-20210814074636-2cb08136a29e/map_test.go (about)

     1  package go_map
     2  
     3  import (
     4  	"strconv"
     5  	"testing"
     6  )
     7  
     8  func BenchmarkMap(b *testing.B) {
     9  	m := New()
    10  	for i := 0; i < 1000000; i++ {
    11  		m.Set(strconv.Itoa(i), i)
    12  	}
    13  	for i := 0; i < 1000000; i++ {
    14  		m.Get(strconv.Itoa(i))
    15  	}
    16  	for i := 0; i < 1000000; i++ {
    17  		m.Delete(strconv.Itoa(i))
    18  	}
    19  }