haskell - 如何分析 IxSet?

标签 haskell profiling happstack

我正在使用 IxSet 继续开发我的程序,我很好奇我是否做错了什么(或者可以优化)。目前它消耗的内存比我想象的要多。

程序在这里:https://bitbucket.org/k_bx/duplicates 分析结果在这里:https://gist.github.com/4602235

附注:请有人添加“ixset”标签,因为我无法创建标签。

更新:

使用 -h 进行内存分析:http://img-fotki.yandex.ru/get/6442/72443267.2/0_9d04d_4be1cd9f_orig

更新2:

同一 -h 文件的整洁内存分析 View :http://heap.ezyang.com/view/c1781ec5e53b00d30a9f8cd02f0b8a5e777674c9#form

最佳答案

您只是使用普通堆分析,它不一定捕获数据结构的使用情况。正如您所指出的,它按代码中的函数分解堆。您可以通过几个选项来通过探查器来获取您想要的内容(来自 ghc 指南: http://www.haskell.org/ghc/docs/latest/html/users_guide/prof-heap.html#rts-options-heap-prof )

-hc (can be shortened to -h). Breaks down the graph by the cost-centre stack which produced the data.

-hm Break down the live heap by the module containing the code which produced the data.

-hd Breaks down the graph by closure description. For actual data, the description is just the constructor name, for other closures it is a compiler-generated string identifying the closure.

-hy Breaks down the graph by type. For closures which have function type or unknown/polymorphic type, the string will represent an approximation to the actual type.

-hr Break down the graph by retainer set.

-hb Break down the graph by biography. Biographical profiling is described in more detail below

hm、hd 和 hr 可能对您最有用。经过一番思考,您还可以使用 hb 获取有关严格性属性的一些信息。

关于haskell - 如何分析 IxSet?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14472958/

相关文章:

haskell - 数据类型的复杂区分是否明智?

haskell - TemplateHaskell 未安装...那么它是

python - cProfile 在调用 numba jit 函数时会增加大量开销

java - 如何测量 OpenCL 读出时间?

haskell - 在 happstack 中捕获纯函数的异常

python - Haskell - 打印多个非字符串变量

haskell - 如何从 Haskell 中的长度生成跨度?

.net - 分析线程同步锁争用

haskell - 如何在 Haskell 中查找类的源代码(实现)

haskell - 使用 Reader 扩展 ServerPartT Monad