Skip to content

Replace IO manager's IntMap with a mutable hash table

I've written a patch that replaces the immutable !IntMap used by GHC.Event with a mutable hashtable, !IntTable.

There's a standalone version of the new data structure, complete with !QuickCheck tests and benchmarks, available on github. It's about 15x faster than !IntMap, and substantially simpler.

In practice, this translates to a small but measurable improvement in throughput (and presumably latency). I see a 3% to 10% bump in requests handled per second by the tiny acme-http http server when benchmarked using the weighttp load tester.

Trac metadata
Trac field Value
Version 7.7
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC AndreasVoellmy, kazu-yamamoto, simonmar
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information