views:

47

answers:

1

I've scoured the internet and this site in search of an answer to my problem to no avail. I'm completely out of ideas and desperate for answers!

The issue:

When I run a specific processor intensive executable from a .NET environment (using Process.Start()), the process takes upwards of five minutes to complete. In contrast, when I run the same executable with the same parameters from a command prompt (cmd.exe), it finishes execution in 10-15 seconds. One observation I've made is that while running from the .NET environment, one of my four processor cores is maxed out; I can see from the output window that it is executing very slowly. With cmd.exe, it appears that all four of my processor cores are sharing the load and things fly by on the output window. Another observation is that csrss.exe has as much processor utilization during the cmd.exe test as the executable I'm running. When running from .NET (Process.Start), this is not the case.

If necessary, I can post the code where I call Process.Start(). I've tried various combinations of setting UseShellExecute to true and false, redirecting the standard input and output, etc.. I simply can't pin this down. I have tested this on two separate machines (Windows Server 2008, and Windows 7 Ultimate) with the same result. I'm using .NET 3.5 SP1 for this particular code base.

Any help would be greatly appreciated!

A: 

Jonathan,

Yes, I am currently NOT redirecting the standard input and output.

Dean,

I've experimented with different affinity mask settings on both the process and the thread without positive results. Maybe I'm not using the right settings?

Adam Elmore
This is not a forum, please post this as comments...ahm...contact an mod to merge your accounts.
Bobby
Yeah, I didn't see an option to add a comment to the first post. This is my first experience ever posting anything to StackOverflow; apologies for any other mistakes such as these.
Adam Elmore
UPDATE:I'm now seeing some instances where the processing seems to be split evenly across several cores; however, the performance remains terrible.Does anyone know why running an executable with Process.Start would perform considerably slower than using cmd.exe (~50x slower).
Adam Elmore