Skip to content

Commit 4d847f5

Browse files
authored
Merge pull request erlang#13 from kjellwinblad/master
Update ordered_set results for OTP 22 highlights post
2 parents abb24fb + ddbe193 commit 4d847f5

File tree

3 files changed

+496
-22
lines changed

3 files changed

+496
-22
lines changed

_posts/2019-5-13-OTP-22-Highlights.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,31 +129,35 @@ very good for performance.
129129

130130
# Write concurrency in `ordered_sets`
131131

132-
[PR1952](https://github.com/erlang/otp/pull/1952) contributed by Kjell Winblad from
133-
Uppsala University makes it possible to do updates in parallel on `ets` tables of
134-
the type `ordered_set`. This has greatly increased the scalability of such ets
135-
tables that are the base for many applications, for instance,
136-
[pg2](http://erlang.org/doc/man/pg2.html) and the default [ssl session cache](http://erlang.org/doc/man/ssl_session_cache_api.html).
132+
[PR1952](https://github.com/erlang/otp/pull/1952) contributed by Kjell
133+
Winblad from Uppsala University makes it possible to do updates in
134+
parallel on `ets` tables of the type `ordered_set`. This together with
135+
other improvements by Kjell Winblad and Sverker Eriksson
136+
([PR1997](https://github.com/erlang/otp/pull/1997) and
137+
[PR2190](https://github.com/erlang/otp/pull/2190)) has greatly
138+
increased the scalability of such ets tables that are the base for
139+
many applications, for instance,
140+
[pg2](http://erlang.org/doc/man/pg2.html) and the default [ssl session
141+
cache](http://erlang.org/doc/man/ssl_session_cache_api.html).
137142

138143
![Ordered Set Write Concurrency OTP 22 benchmark](../images/ordered_set_write_conc.png)
139144

140-
In the benchmark above we can see that when enabling `write_concurrency` on an
141-
`ordered_set` table the operations per seconds possible on a 64 core machine
142-
is almost increased five times when `write_concurrency` is enabled. How much
143-
your application gains from this will depend on the ratio of read and write operations
144-
into the `ordered_set`. You can see the results of many more benchmarks
145-
[here](http://winsh.me/ets_catree_benchmark/ets_ca_tree_benchmark_results.html).
146-
147-
The data structure used to enable `write_concurrency` in the `ordered_set` is called
148-
contention adaptive search tree. In a nutshell, the data structure keeps a shadow
149-
tree that represents the locks needed to read or write a term in the tree. When
150-
conflicts between multiple writers happen, the shadow tree is updated to have
151-
more fine-grained locks for specific branches of the tree. You can read more about
152-
the details of the algorithm in [A Contention Adapting Approach to Concurrent Ordered Sets](http://www.it.uu.se/research/group/languages/software/ca_tree/catree_proofs.pdf).
153-
154-
The original PR had a few places where it still had to fall back to run sequentially,
155-
but that has been fixed in [PR1997](https://github.com/erlang/otp/pull/1997) and then
156-
further optimizations have been done in [PR2190](https://github.com/erlang/otp/pull/2190).
145+
In the benchmark above we can see that on an `ordered_set` table the
146+
operations per seconds possible on a 64 core machine has increased
147+
dramatically between OTP 21 and OTP 22. You can see a description of
148+
the benchmark and the results of many more benchmarks
149+
[here](/bench/ets_ord_set_21_vs_22/21_vs_22.html).
150+
151+
The data structure used to enable `write_concurrency` in the
152+
`ordered_set` is called contention adaptive search tree. In a
153+
nutshell, the data structure keeps a shadow tree that represents the
154+
locks needed to read or write a term in the tree. When conflicts
155+
between multiple writers happen, the shadow tree is updated to have
156+
more fine-grained locks for specific branches of the tree. You can
157+
read more about the details of the algorithm in [A Contention Adapting
158+
Approach to Concurrent Ordered
159+
Sets](https://www.sciencedirect.com/science/article/pii/S0743731517303052)
160+
([PDF](http://www.it.uu.se/research/group/languages/software/ca_tree/catree_proofs.pdf)).
157161

158162
# TLS Improvements
159163

0 commit comments

Comments
 (0)