这是我对一种treap的实现(使用隐式键和一些存储在节点中的附加信息):http://hpaste.org/42839/treap_with_implicit_keys
根据分析数据,GC占用该程序80%的时间.据我所知,这是因为每次节点被"修改"时,都会重新创建到根节点的每个节点.
我能在这里做些什么来提高性能还是我必须进入ST monad的领域?
optimization performance garbage-collection haskell data-structures
有没有人知道数学/几何操作是否有好的宝石?我需要一些这样的东西:
thx,tux
我正在寻找一种有效的方法来从文本文件中读取数字而无需安装其他软件包.Data.ByteString.Lazy.Char8.readInt
似乎是整数的诀窍.我已经读过ByteString
现在有一个readDouble
方法,但是当我编写import Data.ByteString.Lex.Lazy.Double (readDouble)
编译器时抱怨:
Main.hs:4:7: Could not find module `Data.ByteString.Lex.Lazy.Double': locations searched: Data/ByteString/Lex/Lazy/Double.hs Data/ByteString/Lex/Lazy/Double.lhs
我的bytestring包版本是0.9.1.5.
那么,我做错了什么?或者可能有更好的解决方案?谢谢.
更新:好的,似乎readDouble
是在默认情况下未安装的包bytestring-lexer中.还有其他想法吗?