Optimise atomicModifyIORef' implementation (#8345)
authorDavid Feuer <David.Feuer@gmail.com>
Mon, 27 Oct 2014 09:21:20 +0000 (10:21 +0100)
committerHerbert Valerio Riedel <hvr@gnu.org>
Mon, 27 Oct 2014 09:24:21 +0000 (10:24 +0100)
commit9e2cb00e5af9d86546f82a74c3d0382e65704d56
tree7546b6c0ee63094b9239c2722e1df03ede2f4fe5
parent0a290ca0ad599e40ca15a60cc988640f1cfcb4c2
Optimise atomicModifyIORef' implementation (#8345)

This forces the new value before installing it in the IORef.

This optimisation was originally suggested by Patrick Palka
and "exhibits a speedup of 1.7x (vanilla RTS) / 1.4x (threaded RTS)"
according to #8345

Reviewed By: austin, simonmar

Differential Revision: https://phabricator.haskell.org/D315
libraries/base/Data/IORef.hs