views:

84

answers:

2

Hello,

Want To Improvide Performace Of C#.Net Applicaiton..

In My Application I am using Third Party Interop/Dll To Process .doc Files.

It's a Simple Operation, Which Pass Input/Output FilePath to Interop dll ...& dll will execute text form input file.

To Improve Performace I have Tried,

  1. Execute 2 therad to process 32 files.(each Thread process 16 files)
  2. Execute application code by creating 2 new AppDomains(each AppDomain Code process 16 files)
  3. Execute Code Using TPL(Task Parellel Library)

But all options take around same time (32 sec) to process 32 files.Manually process tooks same 32 sec to process 32 files.

Just tried one thing ..when i have created sample exe to process 16 files as input & output for refrence PAth given in TextBox.

..I open 2 exe instance to process. 1 exe has differnt 16 input files & output Created with input file path 2 exe has differnt 16 input files & output Created with input file path

When i click on start button of both exe ..it use 100% cpu & Utilize both core significantly & Process Completed within 16 sec for 32 files.

Can we provide this kind of explicit prallism to Improve my applicaiton Peformace?

Thanks.

+1  A: 

The way to go is to profile your application and see where it is spending its time. Then you can plan to optimise the bottlenecks. Trying to optimise without knowing where the slow part is is not the best use of your time as you are stabbing in the dark, hoping that something works. Find out where the issues are and address those directly.

There are several questions which recommend profilers. Check out this question and this question.

Sam Holder
A: 

The problem could be that your third party tool is somehow synchronizing between threads. This could implicitly happen if it uses single threaded ("STA") COM components to do the work. You could verify this by breaking the app while running in the debugger and look at the call stacks for the worker and UI thread.

jdv