Skip to content

Commit e01ad3e

Browse files
committed
Added benchmarking summary to README.md
1 parent 5fa74fd commit e01ad3e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ go get github.com/linux4life798/safetyfast
1414

1515
Checkout the [SafetyFast Project Page](http://craighesling.com/project/safetyfast).
1616

17+
# Benchmarking
18+
19+
The following plot shows the number of milliseconds it took for 8 goroutines
20+
to increments 480000 random elements (per goroutine) of an array of ints.
21+
The x axis denotes how large (and therefore sparse) the array was.
22+
The synchronization primitive used during the increment is indicated as
23+
a series/line.
24+
25+
![Performance Graph](benchmarks/output-craigmobileworkstation.svg)
26+
27+
Note that, as the array size increases, the likelihood of two goroutines
28+
touching the same element at the same instance decreases.
29+
This is why we see such a dramatic increase in speed, when using either
30+
the HLE or RTM style synchronization primitive.
31+
32+
The `SystemMutex` is just `sync.Mutex`.
33+
1734
# Examples
1835

1936
## Checking for HLE and RTM CPU support

0 commit comments

Comments
 (0)