JIT Compilation Slow

Apologies for the confusion between our initial suspicion and subsequent discoveries. To reiterate:<?xml:namespace prefix = o />

  1. the license file itself is not causing the problem. Wherever we put the license file, the behavior is the same on all locations (local desktops or servers)
  2. if Aspose certain classes (e.g. License or WorkbookDesigner) are used in or returned from any public method of a class, that class takes more than 35 seconds to be COMPILED on certain servers (specs mentioned) for the first time (JIT). This doesn’t happen on subsequent references to these classes
  3. the same classes (containing these Aspose classes) do not take that long to COMPILE on our local desktops
  4. the actual execution of these methods take a second or so on all locations (desktops or servers)

To illustrate, we shall simplify our code here. We have the following classes:

public class ValidationManager

{

//…

public void Validate(…)

{

// Do some stuff here

// log timestamp #1

// now create instance of the following class:

ValidationReportGenerator _repGen = new ValidationReportGenerator(…);

// log timestamp #5

// now call the method:

_repGen.GenerateReport(…);

// log timestamp #6

}

}

The other class (used above) is:

public class ValidationReportGenerator

{

public ValidationReportGenerator()

{

// log timestamp #2 – this is the very first line executed by this instance before anything else is done

// Do stuff

}

public void GenerateReport(…)

{

// Do stuff

// log timestamp #3

WorkbookDesigner designer = new WorkbookDesigner();

// Do more stuff

//… this is a long method

// log timestamp #4

return designer;

}

}

In the above scenario, in accordance to the points mentioned:

  1. the difference between timestamp #1 and #2 = 35 seconds the very first time this part of the code is called. This is even before the method that uses WorkbookDesigner is even called. This (we suspect) is due to the JIT compilation of ValidationReportGenerator
  1. difference between timestamp #3 and #4 ~ 1 second

The above indicates that the JIT compilation takes 35 seconds whereas the execution takes 1 sec. Obviously, once the class has been compiled at runtime, that delay doesn’t occur during subsequent calls.

This kind of code is being executed in our Windows Services, which have a startup timeout of 30 seconds, and hence they fail to startup (due to the 35 JIT compilation delay). I hope this makes things clearer than before. Please advise.


This message was posted using Email2Forum by haley.stuart.

Dear Haley Stuart,

Thanks for reporting. We have logged this issue for investigation with id: CELLSNET-24209.

Please also see if you could create some sample application to simulate this problem and attach here as a zip file.

Also, I have linked your previous thread “Accessing Aspose Classes takes long” with this thread.

Hi,

1) Could you create a web project without Aspose.Cells to check whether it’s the issue of Aspose.Cells?

2) Could you change the timeout of Windows Services now?

3) Please share us some info of server:

Net frame version? IIS version?

Some info on the server configuration : Windows Server 2003 R2, Standard x64 Edition, Service Pack 2. Pentium Xeon L5520 2.27 Ghz, 24 GB RAM with 16 processors.

Framework version is 3.5. BTW its a windows service application that we are talking about and not a web project.

We will upload a sample project as soon as we can.

Hi,

Please try the Aspose.Cells for .NET 5.3.0.3 It includes assemblies without Authenticode signed .

We found signed assemblies loads slower than without Authenticode in test machine
(Win2003, X64,Net Frame 2.0).

Please try it and give your result back here.

And please check this Msdn Document 1.

Thank you for your response, and we confirm that from our test it is faster.

But our concern is that we would have to use this one time unsigned dll going forward. So the question is whether the unsigned version would be part of official download from your site and would you support doing this going forward? And also will you also fix assemblies with Authenticode signed?

Hi ,

1. Using Authenticode signed assemblies.

a) Please install
certificate before using Authenticode signed assemblies, See attached
document
.

b) Please do not verify the certification in your application.
Please check the document: http://msdn.microsoft.com/en-us/library/cc656914.aspx

2.
Adding the unsigned version to official download:

We will look into this.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan