We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unusual load time for the creation of a new Document


We are using the Aspose.Pdf product in order to export an Xps file as a PDF file.
The code for this is very simple, its only 3 lines of code:

LoadOptions options = new XpsLoadOptions();
Document document = new Document(xpsFilePath, options);

This bit of code is included in a bigger project which is deployed on a virtual machine for our multiple clients (each client has his own virtual machine).

The problem is that for several clients, the 2nd line of code is taking more than a minute to complete, while for our other clients, this code completes in less than a second…

We tried to increase the virtual machine’s resources but in vain.

Does anyone have any idea on what could be wrong? Are we missing a line of code that could optimize the creation of the Document?

We have really no idea on what makes the code longer to complete in one case and almost instant in other cases…

Thanks in advance for your help


Thanks for contacting support.

Please note that performance of the API depends upon many factors to be noticed, i.e structure and complexity of input file, environment in which you are using API, version of the API, etc. I have tested a scenario with one of my sample XPS file(s) and was unable to notice the delay in execution. We will really appreciate if you can please share a sample input document along with the environment details which you are running.

We will test the scenario again in our environment and address it accordingly.

Best Regards,
Asad Ali


We’ve made another test this morning. On one of the virtual machines that took a minute to complete the code, we ran a small program in which only the 3 lines of code were added. This simple program took around a second to export the XPS file as a PDF file…
This indicates that the problem comes from our program, and not entirely from the virtual machine. So that’s really weird and even more unexplainable as its the exact same version of our product that is deployed on all virtual machines… So why would it be slow on one VM and fast on the others?
As for some details about the environment, I can give you this:
virtual machine VMWARE 12VCPU 20GB RAM SAS Disk Windows server 2012 R2 64 bits


Thanks for sharing details.

It seems environment specific issue as you have also run a test on another system and was able to notice the difference between performance. May be you can check the entire routine of your program and try executing on another system. It looks like your entire routine is consuming more resources and they are not getting released from memory after code execution.

Furthermore, you may share entire routine of your program/code along with input document, so that we can try to replicate the issue in our environment and respond you accordingly.

Best Regards,
Asad Ali

Sorry for the delay.
As I said, the routine doesn’t take long on all the systems. It’s only specific to some virtual machines, with a 1 second job for some and a whole minute for others…
Also, I don’t think its a problem of resources not getting released, because the time taken to do the job is fix, it does not increase with the program’s life.
The code is fairly simple, I can’t really show you more of it, and it does not depend on the size of the input document or what’s in it, we’ve already checked that… These exact 3 lines are executed in a thread, so that it does not freeze the UI.
I really don’t know what else to say, my hope was that the 3 lines of code could be improved, but you don’t seem to have a problem with it.


Thanks for writing back.

As we have tested the scenario in our environment with our sample document(s) and were unable to notice the issue which you have mentioned, so I am afraid that we cannot log any issue. Please note that we cannot log any needed improvements in the API as well, without noticing/observing the issue in our environment.

We will really appreciate if you share some of your sample document(s), so that we can test the scenario with them in our environment and try to observe the issue which you are experiencing. This would really help us addressing the issue accordingly.

Best Regards,
Asad Ali