Aspose Words Document

Hi,

The Aspose Document class object creation is taking very long time for long content(50 kb) data. Please help me in the issue if there is any alternative.

*maddy1234:
Hi,

The Aspose Document class object creation is taking very long time for long content(50 kb) data. Please help me in the issue if there is any alternative.*

Hi Madhu,

Thanks for your inquiry. Could you please attach your input Word document, you’re getting this problem with, here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

Hi,

The issue occurs even for small content in RTF. Please find the RTF SAMPLE Content in the Attachment.

Hi Madhu,

Thanks for your inquiry.

I tried rendering your RTF document to PDF on my side and while using the latest version of Aspose.Words for Java i.e. 13.2.0, I was unable to reproduce any issue on my side. I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link:
https://releases.aspose.com/words/java

I hope, this helps.

Best regards,

Hi,

Even with the Latest version jar the performance is very slow . Its taking very long time to load large RTF content into the document. This is causing performance issues at our side. Can i chat or call with any technical person so that i can explain my issue more clearly. It would be really helpful if ay technical person from Aspose Words for Java department can chat or talk to me for a while. Please help me.

Hi,

Please find the Sample test data and program in the Attachment which is used to test the time taken for Document Class Object Creation. Its taking atleast 1 second to parse a 500kb content using Document class. Please help as this is causing performance degradation.

Hi Madhu,

Thanks for your inquiry. I have logged your problem in our issue tracking system as WORDSJAVA-698. Our developers will further look into the details of this problem and we will keep you updated on the status of any correction. We apologize for any inconvenience.

Best regards,

Hi,

Can you please provide the Update on this Ticket as it is really urgent. Any Quick Help would be appreciated.

Thanks.

Madhu

Hi Madhu,

Thanks for your inquiry.

Unfortunately, your issue is not resolved yet. Our development team is currently doing analysis of WORDSJAVA-698 and I am afraid, at the moment, we cannot provide you any reliable estimate for the fix of this issue. We will be sure to inform you of any developments on this.

Best regards,

Hi Madhu,

Thanks for your patience. Our development team has completed the work on your issue (WORDSJAVA-698) and has come to a conclusion that this issue and the undesired performance/speed you’re observing on your side is actually not a bug in Aspose.Words. So, we’ve closed this issue as ‘Not a Bug’. The Document load time depends on JVM optimization; for example, if host computer is configured as server then optimization will be much better. If we can help you with anything else, please feel free to ask.

Best regards,

Hi Awais,

While i was testing the Aspose Document . It was taking 6316 Milli Seconds to Parse 25kb RTF Content . My system configuration is Windows7 OS , 8GB RAM. Is it the same behavior as you have observed at your developer end. Please let me know your findings. Please find the Saample Content in the Attachment for Testing

Thanks,

Madhu

Hi Madhu,

Thanks for your inquiry. The first time when your RTF document was loaded into Aspose.Words’ DOM on my side took 1827 milliseconds; it took 1004 and 1016 milliseconds respectively to load the second and third times. Moreover, I tested your scenario using java version 1.7 on my side. Please let me know if I can be of any further assistance.

Best regards,

Hi Awais,

According to your findings in the previous reply its clear that your parser is taking atleast One Second to load a 12 kb RTF Content File. Is this the expected behaviour of Aspose Document. If Yes, Please let me know if there any way to improve the performance of the Parsing the RTF Content. Please share the sample code with which you have Tested the RTF Parsing. Thanks in Advance.

Hi Madhu,

Thanks for your request.

I have intimated our development team of your concern and asked the responsible developer to take a look at your issue if we can improve load time further. Moreover, we have just released a new version of Aspose.Words here, I would suggest you please upgrade to the latest version of Aspose.Words. I hope, this helps.

Secondly, I have used the following code for testing your scenario on my side:

BufferedReader br = new BufferedReader(new FileReader("C:\Temp\rtfContent.rtf"));

String sCurrentLine;

StringBuilder stringBuilder = new StringBuilder();

while ((sCurrentLine = br.readLine()) != null)
{

    stringBuilder.append(sCurrentLine);

}

InputStream is = new ByteArrayInputStream(stringBuilder.toString().getBytes());

LoadOptions loadOptions = new LoadOptions();

loadOptions.setLoadFormat(LoadFormat.RTF);

loadOptions.setPreserveIncludePictureField(true);

long startTime = System.currentTimeMillis();

Document newDocument = new Document(is, loadOptions);

System.out.println("Document Creation time = " + (System.currentTimeMillis() - startTime));
DocumentBuilder builder = new DocumentBuilder(newDocument);

ByteArrayOutputStream outputStreamData = new ByteArrayOutputStream();

startTime = System.currentTimeMillis();

builder.getDocument().save(outputStreamData, SaveFormat.TEXT);

System.out.println("Document Saving time = " + (System.currentTimeMillis() - startTime));

Best regards,

Hi Awais,

We have not seen any improvement in the Performance of the Aspose Document Class. According to my findings with its performance has even more decreased in 13.3.0 . Please test it at your side with the same sample code, sample data**(sampleTest.rar)** and differentiate between 13.2.0 and 13.3.0 versions jars. Please find my findings as shown below

1) Aspose Words 13.2.0 Aspose.Words.jdk16.jar
Document Creation time = 1503
Document Saving time = 55

2) Aspose Words 13.3.0 Aspose.Words.jdk16.jar
Document Creation time = 1526
Document Saving time = 61

Any help will be greatly appreciated.

Hi Madhu,

Thanks for the additional information.

Aspose components are designed to be simultaneously used by 100s and 1000s of users. Unfortunately, we don’t have any particular performance testing results. However, I have communicated your concern to our development team and asked the responsible developer to take a look at your issue to confirm if we can improve load time further. I will update you as soon as I have extra information.

Best regards,

Hi Awais,

We have made few Jprofiling tests with the different versions of aspose jar like 11.9.0 , 13.2.0 and 13.3.0. Please find the results and sample content in the Attachment(documentParsing.rar). We were not able find any difference in the new versions. I hope my findings could help you in the process.

Thanks

Madhu

Hi Madhu,

Thanks for the additional information. I have tested the scenario and have managed to reproduce the same problem on my side on a Windows 7 machine. For the sake of correction, I have logged this problem as WORDSJAVA-714 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Hi Madhu,

You entered on slippery road of profiling and performance measuring :). It is a thankless task.

First of all, I don’t understand why you are using DocumentBuilder everywhere. The same thing (loading in one format and saving in another) can be done by two lines in Aspose.Words.

The second question, what exactly you want to test? JVM, JVM options, JVM JIT optimization, IO-performance, Aspose.Words performance – it is too many things inside your test loop. Why you use only 100 iterations? Why the very first load is inside the loop?

On my environment the very first document is loaded within 700ms. All subsequent documents (inside the loop) are loaded within 9-10ms each. May be my JVM loads all Aspose.Words classes during the first doc load, may be it optimizes all subsequent loads – I don’t know. Here is my code to test your document:

@Test
public void TestLoadSave() throws Exception
{
    TestUtil.setUnlimitedLicense();
    String inputFile = "C:\\Windows\\Temp\\RTFSample.rtf";
    Document document;
    int count = 1000;

    // if commented-out 1-doc time is 18ms for 100 docs and 11ms for 1000 docs,
    // if uncommented 1-doc time is 10-11ms for 100 and 9-10 for 1000 docs.
    // document = new Document(inputFile);
    // document.save(inputFile + ".out.txt");

    long start = System.currentTimeMillis();
    for (int i = 0; i <count; i++)
    {
        document = new Document(inputFile);
        document.save(inputFile + ".out.txt");
    }
    long time = System.currentTimeMillis() - start;

    System.out.println("elapsed time for " + count + " docs: " + time + " - " + time / count + "ms for doc");
}

Regards,