funcAddMap() { now:=time.Now().Unix() fmt.Println(now) for i := 0; i < 10000; i++ { mmp := make(map[string]int) for ia := 0; ia < 100000; ia++ { v := ia mmp[strconv.Itoa(ia)] = v } } fmt.Println(time.Now().Unix()-now) }
funcAddMap() { now:=time.Now().Unix() fmt.Println(now) for i := 0; i < 10000; i++ { mmp := make(map[string]*int) for ia := 0; ia < 100000; ia++ { v := ia mmp[strconv.Itoa(ia)] = &v } } fmt.Println(time.Now().Unix()-now) }