Skip to content

Commit

Permalink
update benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
alphadose committed Sep 15, 2022
1 parent 4a41768 commit ad35641
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 135 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,27 @@ All results were computed from [benchstat](https://pkg.go.dev/golang.org/x/perf/
1. Concurrent Reads Only
```
name time/op
HaxMapReadsOnly-8 7.13µs ± 5%
GoSyncMapReadsOnly-8 22.4µs ± 2%
CornelkMapReadsOnly-8 8.28µs ± 1%
HaxMapReadsOnly-8 6.94µs ± 4%
GoSyncMapReadsOnly-8 21.5µs ± 3%
CornelkMapReadsOnly-8 8.39µs ± 8%
```


2. Concurrent Reads with Writes
```
name time/op
HaxMapReadsWithWrites-8 8.44µs ± 5%
GoSyncMapReadsWithWrites-8 26.1µs ± 2%
CornelkMapReadsWithWrites-8 9.55µs ± 2%
HaxMapReadsWithWrites-8 8.23µs ± 3%
GoSyncMapReadsWithWrites-8 25.0µs ± 2%
CornelkMapReadsWithWrites-8 8.83µs ±20%
name alloc/op
HaxMapReadsWithWrites-8 1.22kB ± 6%
GoSyncMapReadsWithWrites-8 6.06kB ± 6%
CornelkMapReadsWithWrites-8 1.56kB ± 5%
HaxMapReadsWithWrites-8 1.25kB ± 5%
GoSyncMapReadsWithWrites-8 6.20kB ± 7%
CornelkMapReadsWithWrites-8 1.53kB ± 9%
name allocs/op
HaxMapReadsWithWrites-8 152 ± 6%
GoSyncMapReadsWithWrites-8 562 ± 6%
CornelkMapReadsWithWrites-8 195 ± 5%
HaxMapReadsWithWrites-8 156 ± 5%
GoSyncMapReadsWithWrites-8 574 ± 7%
CornelkMapReadsWithWrites-8 191 ± 9%
```

From the above results it is evident that `haxmap` takes the least time, memory and allocations in all cases making it the best golang concurrent hashmap in this period of time
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replace github.com/alphadose/haxmap => ../

require (
github.com/alphadose/haxmap v0.0.0-00010101000000-000000000000
github.com/cornelk/hashmap v1.0.7
github.com/cornelk/hashmap v1.0.8
)

require github.com/cespare/xxhash v1.1.0 // indirect
2 changes: 2 additions & 0 deletions benchmarks/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ github.com/cornelk/hashmap v1.0.6 h1:ZNxfMue8uqQdjI36f7e8o8JqqQMcz5ybk7AH5EqfoQM
github.com/cornelk/hashmap v1.0.6/go.mod h1:DqXRj31DMSQGWQJit5c3jpIErEoTlZYmKhAlBGrf0Sw=
github.com/cornelk/hashmap v1.0.7 h1:9W5NPASHKJ13gl37bgHNPT4rntj1YFGl5a1Uro7HpA8=
github.com/cornelk/hashmap v1.0.7/go.mod h1:RfZb7JO3RviW/rT6emczVuC/oxpdz4UsSB2LJSclR1k=
github.com/cornelk/hashmap v1.0.8 h1:nv0AWgw02n+iDcawr5It4CjQIAcdMMKRrs10HOJYlrc=
github.com/cornelk/hashmap v1.0.8/go.mod h1:RfZb7JO3RviW/rT6emczVuC/oxpdz4UsSB2LJSclR1k=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=
Expand Down
Loading

0 comments on commit ad35641

Please sign in to comment.