Tools for profiling OCaml code

╄→гoц情女王★ 提交于 2019-12-03 23:20:45

poorman's profiler is perfectly applicable for OCaml programs. The same idea works out for profiling allocations as well.

Never used it but ocamlviz is another option.

You can also use ocaml-memprof, a compiler patch (3.12.0 and 3.12 1) written by Fabrice Le Fessant, that adds memory profiling features to ocaml programs.

EDIT

Now you have ocp-memprof, an OCaml Memory Profiler that you can use online. It is available on http://memprof.typerex.org.

anol

Adding to the list of useful answers: this OCamlPro post mentions performance profiling (not memory profiling) of native code on Linux using perf (installed via package linux-tools in Debian-like distributions).

Basically, you just need to run:

perf record -g ./native_program arguments

To produce a perf.data file containing profiling data, and then run

perf report -g

To see the results.

It works better when using an OCaml release with frame pointers enabled (e.g. 4.02.1+fp instead of 4.02.1 on OPAM).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!