I have a rather large solution revolving around a WebAPI project. I ran into some performance issues on a particular web service, and used the built-in performance profiler in VS2013 to find the bottlenecks and deal with them. Eventually I got the response time on a HTTP request down from around 500ms to 50ms (I use an external app to perform repeated requests and log the round-trip time).
However, I only see this improvement while running the WebAPI from the performance profiler tool. As soon as I switch back to running it straight from Visual Studio (F5) or on our test server, the response times increase to around 400ms, still an improvement on the original 500, but not exactly magnificent.
It only makes a slight difference if I run it in debug mode or release mode. Setting "debug info" to "none" rather than the default "pdb-only", on all the involved projects helps a tiny bit, bringing the average response time down to around 350ms.
I can't for the life of me, figure out what the performance profiler tool does to optimize the code further. And it's killing me that I've seen how fast it can run, but I'm unable to achieve the same performance.