@rw3
We have tested the performance on both Windows and Linux.
Here is the test environment:
1, Windows7 64bit, 8GB memory. Test using VS 2017, NUnit3.9.
2, Ubuntu Linux 16.04, 64bit, work on VMware, 2GB memory. test using NUnitLite 3.10.
And, here is the test result:
1, Open the test file and save it, for only one time.
Workbook workbook = new Workbook(Constants.sourcePath + “TMP - Plan Call Page.xlsm”);
workbook.Save(Constants.destPath + “TMP - Plan Call Page.pdf”, SaveFormat.Pdf);
On Windows, it costs about 3.5 seconds.
On Linux, it costs about 7 seconds.
2, Open the test file and save it, for 5 times.
Workbook wb = new Workbook(Constants.TemplatePath + “TMP - Plan Call Page.xlsm”);
wb.Save(Constants.TemplatePath + “PlanCall_out1.pdf”, SaveFormat.Pdf);
wb = new Workbook(Constants.TemplatePath + "TMP - Plan Call Page.xlsm");
wb.Save(Constants.TemplatePath + "PlanCall_out2.pdf", SaveFormat.Pdf);
wb = new Workbook(Constants.TemplatePath + "TMP - Plan Call Page.xlsm");
wb.Save(Constants.TemplatePath + "PlanCall_out3.pdf", SaveFormat.Pdf);
wb = new Workbook(Constants.TemplatePath + "TMP - Plan Call Page.xlsm");
wb.Save(Constants.TemplatePath + "PlanCall_out4.pdf", SaveFormat.Pdf);
wb = new Workbook(Constants.TemplatePath + "TMP - Plan Call Page.xlsm");
wb.Save(Constants.TemplatePath + "PlanCall_out5.pdf", SaveFormat.Pdf);
On Windows, it costs about 4.5 seconds.
On Linux, it costs about 9 seconds.
We repeat above tests for several times, and we can confirm the time cost has been correctly recorded.
1, When we run a DLL, it will cost several seconds to do the initialization operation.
The system(Windows or Linux) call a DLL need to do initialization, and our DLL need to initialize some static parameters, and so on.
Based on the system difference, and environment difference(for example, 8GB memory windows, 2GB memory Linux on VMWare), the initialization time may be different.
That is why we open and save the test file for one time, it costs a long time (3.5 seconds on Windows, and 7 seconds on Linux).
2, Then we open and save the test file for 5 times, to see the real “file open and save time” cost.
Based on the time data recorded above, we can approximately get:
The initialization operation cost 3 seconds on Windows, 6 seconds on Linux.
The “file open and save time” is 0.3 second on Windows, 0.6 second on Linux.
So, please check the test again on your environment, run the “open and save” for more than one time, to see the real time cost.
Maybe you ignored the initialization time on Windows, then you get the conclusion: 100ms on Windows, 10 seconds on Linux.
We can see that on Linux(2GB) is slower than on Windows(8GB), for one time, but not for 1000 times.