Hi,
I have a question about Aspose PDF for .NET.
If I have one request call function A (which contain Document.Save() ), it took about ~200 ms to perform. But when I have 10 concurrent requests call function A, it’s quite slow (~1000-1500 ms). Do you have any ideas for this?
My Aspose version is 22.2.0
Regards,
Hung
It is quite difficult to answer such questions because CPU performance and memory usage all depend on complexity and size of the documents you are loading/generating. A simple or small size document may contain complex structure and a lot of elements in it that leads to large memory consumption because the API loads all required resources in the memory while processing it.
Please share the input PDF files and create a sample console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing. We will investigate the issue and provide you more information on it.
Hi @tahir.manzoor,
This is my project demo.
As my expectation, when doing the concurrent job, the time consumed to save each document should be approximate with save each document synchronous.
And one more thing, the first time when I saved a document, it take time more than other remaining docs (You can see console log when running app for the datails). Do you have any idea about this case?
Regards,
Hung
AsposePDFDemo.zip (2.2 MB)
We have logged this problem in our issue tracking system as PDFNET-51569. You will be notified via this forum thread once this issue is resolved.
We apologize for your inconvenience.
@tahir.manzoor
Can you update the status of this ticket? Or when you can update the answer for this?
I’m looking forward to hearing from you.
Currently, your issue is pending for analysis and is in the queue. Once we complete the analysis of your issue, we will then be able to provide you an estimate.
We regret to share with you that there is no update available on this issue at the moment. We will be sure to inform you via this forum thread once there is an update available on it.
It is to inform you that the issue you are facing is not a bug in Aspose.PDF. We tested your code and got the expected result - 2 times acceleration on 4 cores.
- To consider multithreading a panacea is not true. An attempt to run 10 threads on one core will lead not to an increase, but to a decrease in speed. Because there are overhead costs for switching threads.
- If several threads access the shared resource, then one will be able to use it, all the others will wait. Such resources are inside “Aspose.Pdf”.
- Some Windows OS libraries have internal access restrictions. For example, System.Drawing (for working with images). If several threads access some of the functions of such a library, then one will be able to use it, all the others will wait.