stm
stm copied to clipboard
Faster tryReadTMVarIO
Given that under the hood it's just TVar (Maybe a), we could have a faster equivalent of readTVarIO that doesn't do STM transaction accounting.
As a side note: the costs are not huge, but with the large number of operations in a transaction they add up to a lot of time, so this issue should be better documented - we had 40min execution time cut down to 10 sec by simply replacing atomically . mapM readTVar
with mapM readTVarIO
and a similar effects will be obtained with tryReadTVar[IO].