Switch IO manager to a mutable hashtable
authorBryan O'Sullivan <bos@serpentine.com>
Wed, 14 Aug 2013 10:43:36 +0000 (03:43 -0700)
committerAndreas Voellmy <andreas.voellmy@gmail.com>
Tue, 3 Sep 2013 20:05:05 +0000 (16:05 -0400)
commit28cf2e004da0fc809ce9efff0802b125b3501e91
tree76616b6919583eac77ad8e19bc4fbd4fc19580eb
parentcc99f64a5e15f0c40a4f24dd6e13d95af9455e09
Switch IO manager to a mutable hashtable

This data structure (IntTable) provides a similar API to its predecessor
(IntMap), at half the number of lines in size.

When tested in isolation using criterion, IntTable is much faster than
IntMap: over 15x, according to my criterion benchmarks.

This translates into a measurable improvement when used in the IO manager:
using weighttp to benchmark acme-http under various configurations on two
32-core Linux servers connected by a 10gbE network, I see between a 3%
and 10% increase in requests served per second compared to IntMap.

Signed-off-by: Andreas Voellmy <andreas.voellmy@gmail.com>
libraries/base/GHC/Event/Arr.hs [new file with mode: 0644]
libraries/base/GHC/Event/IntMap.hs [deleted file]
libraries/base/GHC/Event/IntTable.hs [new file with mode: 0644]
libraries/base/GHC/Event/Manager.hs
libraries/base/GHC/Event/Thread.hs
libraries/base/base.cabal