Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Change formatting for readability.
  • Loading branch information
umpc authored Oct 31, 2017
1 parent b9a2b80 commit 36ca38a
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ func main() {
iterCh, err := sm.BoundedIterCh(reversed, lowerBound, upperBound)
if err != nil {
fmt.Println(err)
} else {
defer iterCh.Close()
return
}
defer iterCh.Close()

for rec := range iterCh.Records() {
fmt.Printf("%+v\n", rec)
}
for rec := range iterCh.Records() {
fmt.Printf("%+v\n", rec)
}
}
```
Expand All @@ -68,8 +68,19 @@ Check out the [examples](https://github.com/umpc/go-sortedmap/tree/master/exampl
## Benchmarks

```sh
BenchmarkNew-8 20000000 98.8 ns/op 96 B/op 2 allocs/op

BenchmarkHas1of1CachedRecords-8 50000000 27.3 ns/op 0 B/op 0 allocs/op
BenchmarkHas1of1Records-8 20000000 94.1 ns/op 0 B/op 0 allocs/op

BenchmarkGet1of1CachedRecords-8 50000000 27.3 ns/op 0 B/op 0 allocs/op
BenchmarkGet1of1Records-8 20000000 96.8 ns/op 0 B/op 0 allocs/op

BenchmarkDelete1of1Records-8 5000000 285 ns/op 0 B/op 0 allocs/op

BenchmarkInsert1Record-8 3000000 442 ns/op 304 B/op 2 allocs/op
BenchmarkReplace1of1Records-8 5000000 378 ns/op 0 B/op 0 allocs/op

BenchmarkDelete1of10Records-8 2000000 615 ns/op 0 B/op 0 allocs/op
BenchmarkDelete1of100Records-8 1000000 1005 ns/op 0 B/op 0 allocs/op
BenchmarkDelete1of1000Records-8 1000000 1987 ns/op 0 B/op 0 allocs/op
Expand All @@ -80,31 +91,21 @@ BenchmarkBatchDelete100of100Records-8 30000 47069 ns/op 112
BenchmarkBatchDelete1000of1000Records-8 2000 721201 ns/op 1024 B/op 1 allocs/op
BenchmarkBatchDelete10000of10000Records-8 100 19275331 ns/op 10240 B/op 1 allocs/op

BenchmarkGet1of1CachedRecords-8 50000000 27.3 ns/op 0 B/op 0 allocs/op
BenchmarkGet1of1Records-8 20000000 96.8 ns/op 0 B/op 0 allocs/op

BenchmarkBatchGet10of10Records-8 2000000 902 ns/op 176 B/op 2 allocs/op
BenchmarkBatchGet100of100Records-8 300000 5550 ns/op 1904 B/op 2 allocs/op
BenchmarkBatchGet1000of1000Records-8 30000 49057 ns/op 17408 B/op 2 allocs/op
BenchmarkBatchGet10000of10000Records-8 2000 710611 ns/op 174080 B/op 2 allocs/op

BenchmarkHas1of1CachedRecords-8 50000000 27.3 ns/op 0 B/op 0 allocs/op
BenchmarkHas1of1Records-8 20000000 94.1 ns/op 0 B/op 0 allocs/op

BenchmarkBatchHas10of10Records-8 2000000 742 ns/op 16 B/op 1 allocs/op
BenchmarkBatchHas100of100Records-8 300000 5102 ns/op 112 B/op 1 allocs/op
BenchmarkBatchHas1000of1000Records-8 30000 46257 ns/op 1024 B/op 1 allocs/op
BenchmarkBatchHas10000of10000Records-8 3000 519497 ns/op 10240 B/op 1 allocs/op

BenchmarkInsert1Record-8 3000000 442 ns/op 304 B/op 2 allocs/op

BenchmarkBatchInsert10Records-8 300000 4164 ns/op 1382 B/op 8 allocs/op
BenchmarkBatchInsert100Records-8 30000 54184 ns/op 14912 B/op 19 allocs/op
BenchmarkBatchInsert1000Records-8 2000 844344 ns/op 201969 B/op 78 allocs/op
BenchmarkBatchInsert10000Records-8 100 25911455 ns/op 2121554 B/op 584 allocs/op

BenchmarkReplace1of1Records-8 5000000 378 ns/op 0 B/op 0 allocs/op

BenchmarkReplace1of10Records-8 1000000 1021 ns/op 0 B/op 0 allocs/op
BenchmarkReplace1of100Records-8 1000000 1669 ns/op 0 B/op 0 allocs/op
BenchmarkReplace1of1000Records-8 500000 3187 ns/op 0 B/op 0 allocs/op
Expand All @@ -114,8 +115,6 @@ BenchmarkBatchReplace10of10Records-8 200000 6934 ns/op 0
BenchmarkBatchReplace100of100Records-8 10000 100186 ns/op 0 B/op 0 allocs/op
BenchmarkBatchReplace1000of1000Records-8 1000 1546355 ns/op 0 B/op 0 allocs/op
BenchmarkBatchReplace10000of10000Records-8 20 58396360 ns/op 0 B/op 0 allocs/op

BenchmarkNew-8 20000000 98.8 ns/op 96 B/op 2 allocs/op
```

The above benchmark tests were ran using a 4.0GHz Intel Core i7-4790K (Haswell) CPU.
Expand Down

0 comments on commit 36ca38a

Please sign in to comment.