Address delay in loading Aspose license

Related to this previous issue:

It seems the aspose license takes about 15 seconds to load each time our javaworker picks up a job
image.png (55.6 KB)

Multiply this by about 400 workers, and you can see that this delay becomes quite substantial in terms of time and cost. Was wondering if there is any resolution to be able to cut down this time, or not need it loaded for each and every job the worker picks up. Please let me know, thanks!
Here’s the code snippet of what we do to load the license
image.png (43.1 KB)

Here’s the versions of each we are currently using
com.aspose:aspose-words:22.7
org.jogamp.jogl:jogl-all-main:2.3.2
org.jogamp.jogl:jogl-all:2.3.2
org.jogamp.gluegen:gluegen-rt-main:2.3.2
org.jogamp.gluegen:gluegen-rt:2.3.2
com.aspose:aspose-pdf:23.1
com.aspose:aspose-cells:22.7
com.aspose:aspose-note:21.11
com.aspose:aspose-imaging:22.7
com.aspose:aspose-email:22.6
com.aspose:aspose-slides:22.6

@JakeatEpiq22,

It is recommended to set Aspose license in the start method or at the start of the application. You should do license initialization and setting only once in the whole application life cycle. To initialize and set license for each and every job for the workers is not needed as it will only add to time cost.

Could you please share the time that is taken by each API to load and set license. So, we will know which API is taking more time and we can evaluate your issue accordingly.

“Message”:“Elapsed time get property:0ms”
“Message”:“Elapsed time set slides:1325ms”
“Message”:“Elapsed time set email:658ms”
“Message”:“Elapsed time set imaging:949ms”
“Message”:“Elapsed time set pdf:2286ms”
“Message”:“Elapsed time set cells:153ms”
“Message”:“Elapsed time set words:1646ms”
“Message”:“Elapsed time set note:724ms”

@JakeatEpiq22,

Thanks for the details.

It seems Aspose.PDF, Aspose.Slides and Aspose.Words APIs take a little more time to set the license. Our respective teams from Aspose.PDF, Aspose.Slides and Aspose.Words will evaluate your issue and get back to you soon.

By the way, did you try the recommendations we suggested?

This code is on a worker machine, of which we have hundreds

And these workers scale up and down in AWS, so are constantly starting up
Each time they start up they load these licenses, so it makes it hard for us to optimize it much more than we currently have.

So the loadlicense function that sets all of these has been called something like 24k times over the last 7 days in just one of our environments

@JakeatEpiq22

We have tested the scenario using 23.5 version of the API and license setting took 2-3 seconds in our environment.

Therefore, we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-42847

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

@JakeatEpiq22,
Could you please share the simplest project that reproduces the problem you described? It will be great if you can test the problem with the latest version of Aspose.Slides and share the OS version on which the code was executed.

It seems to be similar load times regardless of size of project, so you can use this one as an example11KB.docx (11.3 KB)
OS version 10.0.19045
Will test with latest version and report back with load times again

@JakeatEpiq22,
Thank you. We will be waiting for your new results.

Using that same file, this was the return time per load for each, using the 23.5 version of slides, where our previous version was 22.6
“Message”:“Elapsed time get property:0ms”
“Message”:“Elapsed time set slides:1839ms”
“Message”:“Elapsed time set email:619ms”
“Message”:“Elapsed time set imaging:616ms”
“Message”:“Elapsed time set pdf:2012ms”
“Message”:“Elapsed time set cells:161ms”
“Message”:“Elapsed time set words:2399ms”
“Message”:“Elapsed time set note:757ms”

@JakeatEpiq22 I have tested applying the Aspose.Words license and it takes about 641ms on my side. It is recommended to apply the license once per application domain, for example in class static constructor.

Also, on the first call Aspose.Words inits static resources, which are then reused on the subsequent calls. You can create an empty document and save it as PDF, for example, on your application start to force Aspose.Words to init resources to avoid “cold” start on the real requests.

@JakeatEpiq22,
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39218

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@JakeatEpiq22,
Regarding Aspose.Slides, our developers have investigated the case, but unfortunately, there is no way to optimize the code.

Since nothing is known about your infrastructure, it is difficult to give advice that would help solve this problem. But usually, problems of this kind were solved by moving the code responsible for initializing the license to a static block of code that can be reused.

The only way we could use this strategy is if we didn’t have the workers scale up and down depending on workload. Which would cause a whole another slew of issues with other things. I’ll keep looking into possible solutions on our end, we just wanted to explore if any sort of optimization could come from your end.

@JakeatEpiq22,
Our developers regularly work on performance optimization in our products, but unfortunately in this case we cannot improve anything yet. We apologize for any inconvenience.