良好的F#性能分析工具 [英] Good F# Performance Profiling Tool

查看:72
本文介绍了良好的F#性能分析工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以推荐具有良好F#支持的性能分析工具吗?

Can anyone recommend a performance profiling tool with good F# support?

我一直在使用Visual Studio 2010分析器,但在使用F#时发现了一些问题.感觉比原始F#更像是我在反射后分析字节码.

I’ve been using Visual Studio 2010 profiler but I’ve found a few issues when using F#. It feels more like I’m profiling the byte code after reflection than the original F#.

例如,在分析以下稍作设计的示例时:

For example when profiling the following slightly contrived example:

let Add a b = 
    a + b

let Add1 = Add 1

let rec MultiAdd count = 
    match count with
    | 1 -> 1
    | _ -> (Add1 1) + (MultiAdd (count - 1))

MultiAdd 10000 |> ignore

我得到以下调用树:

当我在函数详细信息"中查看Microsoft.FSharp.Core.FSharpFunc`2.Invoke(0)时,我看到:

When I view Microsoft.FSharp.Core.FSharpFunc`2.Invoke(0) in the Function Details I see:

我了解我所看到的是基于已编译代码的基础实现的,尽管我可以遵循它,但是很难.

I understand that what I seeing is based on the underlying implementation of the compiled code and although I can follow it, it’s hard going.

有人有使用F#使用其他性能分析工具的经验吗,并且他们在映射到原始F#代码方面做得更好吗?

Does anyone have experience of using other profiling tools with F# and do they do a better job of mapping to the original F# code?

推荐答案

我的回答可能会让您失望,但可能会有所帮助.

My answer may disappoint you, but it might be helpful.

几个月前,我试图为我的F#项目找到一个好的免费 .NET探查器.我对 nprof EQATEC 和(最近是商业化的) Xte剖析器一点也不像样.我发现他们对F#的支持非常有限,因此只能使用Visual Studio 2010 Profiler.我认为您最好的选择是一些商业分析器(我没有经验).

A few months ago, I tried to find a good free .NET profiler for my F# project. My experience with nprof, slimtune, EQATEC and (recently commercial) Xte profiler was not decent at all. I found their support for F# was very limited, and had to fall back to Visual Studio 2010 profiler. I think your best bet here is some commercial profiler (which I have no experience with).

一段时间后,我习惯了探查器,并以简单,清晰和易于理解的方式看到了其结果显示.如果您正在优化并行程序,则不可避免要使用Concurrent Visualizer.就是说,您最关心的就是性能;与VS 2010 Profiler融洽相处是值得尝试的.

After some time, I get used to the profiler and see its presentation of results easy, clear and understandable. If you were optimizing parallel programs, using the Concurrent Visualizer would be unavoidable. That said the single thing you care is performance; getting on well with VS 2010 profiler is worth to try.

对于概要分析F#代码,我还找到了 CLR Profiler ILSpy 值得一提.如果您想最小化内存分配或垃圾回收,前者可以可视化堆.后者可以在IL或C#中产生等效的代码(我比F#更熟悉);可能有助于了解F#中的高阶构造如何工作以正确使用它们.

For profiling F# code, I also find CLR Profiler and ILSpy worth to mention. The former can visualize heaps in case you want to minimalize memory allocation or garbage collection. The latter can produce equivalent code in IL or C# (which I'm more familiar with than F#); it may help to understand how high-order constructs in F# work in order to use them appropriately.

更新:

戴夫·托马斯(Dave Thomas)已撰写一篇出色的博客文章,他在其中使用了几种商用分析器来检测内存泄漏并调整异步应用程序.看一下那些探查器;它们可能适合您的喜好.

Dave Thomas has written an excellent blog post where he used several commercial profilers to detect memory leaks and tune an asynchronous application. Take a look at those profilers; they may suit your preference.

这篇关于良好的F#性能分析工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆