We have more than 100,000 Excel files that need to be converted to PDF files. We are using Aspose products to convert these files and found that it takes more than 1.5 seconds to convert one file. Is there any way I can improve this performance?
I entered ‘test’ in cell A1 using MS Excel and created an XLSX file for testing, resulting in the following data.
First execution: 3.846
Second execution:1.537
My test environment is as follows.
CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0-1
Thread(s) per core: 2
Core(s) per socket: 1
Socket(s): 1
Model name: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
Virtualization: VMware
Virtualization type: full
L1d cache: 32K
l1i cache:32K
L2 cache: 1024K
L3 cache: 2534K
Memory:
Total:7g
used:2g
free:197m
share:235m
buff/cache:5g
available:4g
OS:Red Hat Enterprise Linux 8.2
Dotnet:8.0
Aspose:26.1
@Dyb143 ,
Loading and converting such a simple file should take only milliseconds. The first time running will load font infomation, so it will cost some more time.
Here is a simple project for testing Aspose.Cells for .NET 26.1 with .net8.0.
AsposeCellsRhelTest.zip (7.8 KB)
The cost time is:
------Round: 1------
Loading file: input.xlsx
Load time: 257 ms
Converting to PDF: output.pdf
Convert time: 133 ms
Total time (load + convert): 391 ms
------Round: 2------
Loading file: input.xlsx
Load time: 6 ms
Converting to PDF: output.pdf
Convert time: 5 ms
Total time (load + convert): 12 ms
I ran this program in my environment, and it took 1.4 seconds. I suspect it might be related to the runtime environment. Can you tell me about your environment?
Or is there something wrong with my environment?
@Dyb143 ,
I use this dockerfile.
Dockerfile.zip (472 Bytes)
If possible, please share us a dockerfile that can reproduce the issue on your side.
I’m sorry. My environment cannot connect to the external network, so I cannot generate a Dockerfile.
According to your Dockerfile, I know that you are using AsposeCellsRhelTest.dll, but I am using Aspose.Cells.DLL, and its version is 26.1. What are the differences between them?
Also, could you tell me your hardware configuration and operating system?It may affect performance.
For your information, AsposeCellsRhelTest.dll is actually the application Dll (the project was already provided in the AsposeCellsRhelTest.zip archive we attached previously) that uses Aspose.Cells.Dll 26.1.
Run the code you provided, and the following results will be displayed.
Much slower than the result you got.
Can you give me some solution?
------Round: 1------
Loading file: input.xlsx
Load time: 995 ms
Converting to PDF: output.pdf
Convert time: 439 ms
Total time (load + convert): 1435 ms
------Round: 2------
Loading file: input.xlsx
Load time: 7 ms
Converting to PDF: output.pdf
Convert time: 12 ms
Total time (load + convert): 19 ms
@Dyb143 ,
For the first round, Aspose.Cells builds some cache(e.g. installed font infomation) for later use. This is why the first round costs more time.
Please install the fonts used in the source files. Because if the font is not installed, Aspose.Cells will find another installed font to render the text. This will cost more time.
Also, you may convert more files(e.g. 100 files) to check the total performance instead of single file. Because of the cache built, the later conversion will get better performance.