Apologies for the confusion between our initial suspicion and subsequent discoveries. To reiterate:<?xml:namespace prefix = o />
- 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)
- 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
- the same classes (containing these Aspose classes) do not take that long to COMPILE on our local desktops
- 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:
- 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
- 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.