Running Visual Studio console application in debug mode consumes no more than 50 percent cpu usage

c#, debugging, vb.net, visual-studio, visual-studio-2008

Solution

It sounds like you have a dual-core CPU and your application is single-threaded.

Problem

I have a several C# console applications that basically parse tons of data in memory (LINQ) and output the results to a text file. Now, forget about the writing to the text file for a minute because this is not where the problem is occurring. When I run the application in debug mode, I will never get it to utilize more than 50% of cpu usage. It will be parsing/massaging hundreds of thousands of records, but only go X fast and utilize 50% of the cpu AT MOST (as viewed in the Task Manager). I would really like to use 100% of the CPU to make the processing go faster. Does anybody have any insight? I am running Windows XP Professional with Service Pack 3. I have Visual Studio 2008 Professional with Service Pack 1 installed. Thanks! EDIT: - I have manually set the affinity of the process in Task Manager to a single core on the dual CPU. - Sometimes I can catch it utilizing 51% or 52% of the CPU.

Original source