That does sound fishy! Brainstorming...

(Have to ask: is the benchmark CPU bound? E.g. not talking to a web service that may have slow connection, or anything else silly like that. And I guess you're just running with "Start without Debugging" (Ctrl-F5) in the non-instrumented case?)

A rare possibility may be tail call performance. You might try unchecking 'Generate tail calls' on the Build tab of the project's Properties, and see if that affects the Release mode performance. I can imagine that an instrumentation pass might remove tail calls as part of its IL rewriting.

What is the performance difference between "Debug" and "Release" (both uninstrumented)?

By on 2/19/2010 3:00 PM ()

Thanks for the reply Brian.

It turns out that I am, in fact, an idiot. I was hitting F5 instead of (Ctrl-F5) and, of course, the release configuration was set to optimize code whereas the debug configuration was not.

I am curious, however, about your suggestion that tail calls might cause a performance problem. I'm not using tail calls in my current project, but part of the appeal of F# (to me) is that its compiler will perform tail call optimization. Under what scenarios would this be a bad thing?

Thanks again.

By on 2/20/2010 9:27 AM ()

I am curious, however, about your suggestion that tail calls might cause a performance problem. I'm not using tail calls in my current project, but part of the appeal of F# (to me) is that its compiler will perform tail call optimization. Under what scenarios would this be a bad thing?

You can see e.g.

[link:connect.microsoft.com]

I don't recall all the details, but e.g. maybe on x86 CLR 2.0, given certain sets of function parameters, the CLR implementation had to use some non-JITted helper to make the tail-call happen, and in edge case scenarios this would show up in the overall app's perf. I think CLR 4.0 is now much better at perf here, as well as honoring the .tail IL instruction in general - the CLR team did some great work here for 4.0.

By on 2/20/2010 10:02 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper