Haskell: Data.HashSet (from unordered-container) Performance for Large Sets
问题 The data First of all, let's generate some input so we have concrete data to talk about: python -c 'for f in xrange(4000000): print f' > input.txt this will generate a file input.txt containing the numbers from 0 to 3999999, each on its own line. That means we should have a file with 4,000,000 lines, adding up to 30,888,890 bytes, roughly 29 MiB. Everything as a list Right, let's load everything into memory as a [Text] : import Data.Conduit import Data.Text (Text) import Control.Monad.Trans