Skip to content

Commit dbb28a2

Browse files
authored
Add benchmark results to README
1 parent 8baa298 commit dbb28a2

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Some other approaches to concurrent caches include:
2727
contention.
2828

2929

30-
# Example:
30+
## Example:
3131
```julia
3232
julia> cache = MultiThreadedCache{Int, Int}(Dict(1=>2, 2=>3))
3333
MultiThreadedCache{Int64, Int64}(Dict(2 => 3, 1 => 2))
@@ -50,3 +50,30 @@ julia> get!(cache, 5) do
5050
end
5151
6
5252
```
53+
54+
## Performance
55+
Current benchmark results measuring scaling recorded against a baseline of a Dict() + ReentrantLock():
56+
57+
```
58+
┌ Info: benchmark results
59+
│ Threads.nthreads() = 1
60+
│ time_serial = 0.03260747
61+
│ time_parallel = 0.152217246
62+
└ time_baseline = 0.131397639
63+
```
64+
65+
```
66+
┌ Info: benchmark results
67+
│ Threads.nthreads() = 20
68+
│ time_serial = 0.030174521
69+
│ time_parallel = 0.307062643
70+
└ time_baseline = 1.239406026
71+
```
72+
73+
```
74+
┌ Info: benchmark results
75+
│ Threads.nthreads() = 100
76+
│ time_serial = 0.030373533
77+
│ time_parallel = 1.771401144
78+
└ time_baseline = 5.397114559
79+
```

0 commit comments

Comments
 (0)