您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425
  1. import Protolude
  2. import Criterion
  3. import Criterion.Main
  4. import qualified Data.Vector as V
  5. import qualified HFIG.Dictionary as Dict
  6. import qualified HFIG.Lovecraftian as Lov
  7. import qualified HFIG.Short as Short
  8. main :: IO ()
  9. main = do
  10. englishDict <- Dict.dictionaryFromFile "dictionaries/english.txt"
  11. putText $ "loaded english Dict: " <> (show (V.length englishDict) :: Text)
  12. genericDict <- Dict.dictionaryFromFile "dictionaries/generic.txt"
  13. putText $ "loaded generic Dict: " <> (show (V.length genericDict) :: Text)
  14. defaultMain [ bench "short idgen (10)" (nfIO (Short.idgen 10))
  15. , bench "short idgen (100)" (nfIO (Short.idgen 100))
  16. , bench "lovecraftian idgen (1)" (nfIO (Lov.idgen 1))
  17. , bench "lovecraftian idgen (10)" (nfIO (Lov.idgen 10))
  18. , bench "dictionary idgen (english 3)"
  19. (nfIO (Dict.idgen englishDict 3))
  20. , bench "dictionary idgen (generic 3)"
  21. (nfIO (Dict.idgen genericDict 3))
  22. ]