RE: Threaded Word File Conversion
- From: jialge@xxxxxxxxxxxxxxxxxxxx (Jialiang Ge [MSFT])
- Date: Tue, 18 Mar 2008 03:56:33 GMT
Using the single threaded with one application object takes
seconds per file. To slow but at least it works.
Hello Chuck, honestly, I am a little surprised to see it takes seconds per
file. I conducted a test on my side, and it turned out to be only 0.355
seconds on average.
I created a folder which 1000 doc files whose size ranges from 120KB to
240KB, then I new a C# Console project from Visual Studio 2005 and
copy&paste the code I demonstrated in the last reply to it. In order to get
the total run time , I wrote the main function as:
static void Main(string[] args)
{
DateTime start = DateTime.Now;
ConvertFiles();
DateTime end = DateTime.Now;
TimeSpan span = end - start;
Console.WriteLine(span.Minutes.ToString() + "mins " +
span.Seconds.ToString());
}
The result is "5mins 55", namely, 0355 seconds per file. I repeated the
test for several times, and the result is almost the same.
My CPU is Intel? Core(TM)2 6300@xxxxxxx, with 2GB RAM
Therefore, I start to suspect if the low performance on your side results
from other factors? Is it because the files to be converted are too large
(e.g. 10MB)? Or is it due to the network bandwidth constraints if the files
are not on local machine?
And regarding the Threaded issue, this problem is most likely caused that
your COM objects are called on different threads. By default Office use STA
apartment model so if you are using COM objects in different threads, this
may cause issues like interop exceptions "object disconnected from its RCW".
Regards,
Jialiang Ge (jialge@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support
=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
.
- References:
- Threaded Word File Conversion
- From: Chuck P
- RE: Threaded Word File Conversion
- From: Jialiang Ge [MSFT]
- RE: Threaded Word File Conversion
- From: Chuck P
- Threaded Word File Conversion
- Prev by Date: Printing PowerPoint as PDF -> Param PrintRange fails !!!
- Next by Date: RE: Threaded Word File Conversion
- Previous by thread: RE: Threaded Word File Conversion
- Next by thread: RE: Threaded Word File Conversion
- Index(es):
Relevant Pages
|