Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio F5 debugging is slower than Attach to Process

If i start my application with F5 (debugging) it takes for a certain operation about 2000ms. If i start the application with F5 + CTRL (without debugging) and attach Visual Studio with "Attach to Process" it takes only ~100ms.

Has someone a idea what component can cause this performance 'problem'?

C# application / VS 2012.

Edit

Code-Snipped:

Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
changed.Validate(context);
stopwatch.Stop();
Console.WriteLine(stopwatch.ElapsedMilliseconds);
like image 456
Im4Ever Avatar asked Nov 10 '22 23:11

Im4Ever


1 Answers

One major thing that makes lot of difference is during F5 or debugging visual studio loads all the pdb files.pdb files are the program database files and are the reason why you are able to debug.If you compile in build mode you will see the bin folder having .pdb file corresponding to every dll.

More on pdb files : http://msdn.microsoft.com/en-us/library/yd4f8bd1(vs.71).aspx

one article on this topic http://blogs.msdn.com/b/zainnab/archive/2010/11/01/start-debugging-vs-start-without-debugging-vstipdebug0037.aspx

like image 64
Jags Avatar answered Nov 14 '22 23:11

Jags