没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
哈希图 总览 Golang无锁无线程安全HashMap,针对最快的读取访问进行了优化。 用法 为地图中的键设置值: m := &HashMap{} m.Set("amount", 123) 从地图中读取键的值: amount, ok := m.Get("amount") 使用地图来计数URL请求: var i int64 actual, _ := m.GetOrInsert("api/123", &i) counter := (actual).(*int64) atomic.AddInt64(counter, 1) // increase counter ... count := atomic.LoadInt64(counter) // read counter 基准测试 以线程安全的方式从哈希映射中进行读取的速度几乎与以不安全的方式从标准Golang映射中进行读取的速度相同,是Go的sync.Map的sync.Map 。 BenchmarkReadHashMapUint-8 200000 6830 ns/op Benchmark
资源推荐
资源详情
资源评论
收起资源包目录
hashmap-master.zip (16个子文件)
hashmap-master
.travis.yml 384B
hashmap.go 12KB
hashmap_get.go 4KB
list.go 5KB
util_test.go 2KB
LICENSE 11KB
.gitignore 28B
.codecov.yml 101B
go.sum 169B
README.md 3KB
list_test.go 260B
util.go 2KB
hashmap_test.go 14KB
listelement.go 1KB
go.mod 85B
benchmark_test.go 6KB
共 16 条
- 1
资源评论
邱笑晨
- 粉丝: 39
- 资源: 4553
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功