开发者

C# Tiff to Doc conversion performance issue

开发者 https://www.devze.com 2023-02-02 21:49 出处:网络
I\'m having this issue here\'s the scenario: I have a file watcher service looking out for a delimited .txt file and do some manipulation. After manipulation, I\'ll be calling a webservice which will

I'm having this issue here's the scenario: I have a file watcher service looking out for a delimited .txt file and do some manipulation. After manipulation, I'll be calling a webservice which will convert a multipage tiff file to a word document(.doc) and some other manipulations开发者_如何学Python.

I'm running a threadpool at the file watcher service level calling the web service. I've finally pin pointed and drilled downn that the bottleneck occurs at the conversion of the .tiff to .doc stage.

A little info, the .tiff that I'm working on is around 50 pages and 4.3 mb. I'm looking to convert a few thousands of such files (which might be bigger).

I've tried to run the conversion of the .tiff in a threadpool but that did not help shaving off the time.

I wonder what could help in the performance of this conversion.


If you really are using OCR software to convert the tiff the TIFF into a DOC (not embedding an image in a doc), I don't think there's a solution to your problem other than faster hardware or better OCR software.


I've finally pin pointed and drilled downn that the bottleneck occurs at the conversion of the .tiff to .doc stage.

That's not exactly a pinpoint. Sounds like it's a very big section of the code. If you're using a third party component then you need to address it with the vendor. If it's your own code then you need to be more specific about where the performance problem is occurring.

It's also worth noting that simply putting code on a background thread will not make it faster. In most cases it will make it slower unless you are able to break the job up into chunks that can run concurrently on physical CPU cores or there is substantial waiting on I/O or locks. If you're using a third party component then there's probably not much you can do with threads to make a single conversion job perform faster.


answer was kind of solved when i ported the codes to an 8 core server

0

精彩评论

暂无评论...
验证码 换一张
取 消