Performance degradation from 18.9.0 to 24.3.0

Hello,
We are in the process of evaluating a migration from Aspose.Words version 18.9.0 to version 24.3.0. During our testing and evaluation phase, we have encountered some issues, particularly with performance degradation.

I’ve attached the source code of our test solution. This includes two console projects for comparative purposes:

  • Aspose.Evaluator.Client18_9_0 using the previous version we are currently using (18.9.0)
  • Aspose.Evaluator.Client23_3_0 using the latest version, 24.3.0 – the one we are evaluating

Aspose.Evaluator.zip (142.6 KB)

Our result shows the following:

  • Using Aspose.Words version ‘18.9.0’

Starting performance tests for ‘100’ …
operation new Document(wordTemplate) executed in 1285ms with an avg of 012,850ms
operation UpdateXml(doc, xmlBytes) executed in 0ms with an avg of 000,000ms
operation doc.UpdateFields() executed in 169ms with an avg of 001,690ms
operation doc.UpdatePageLayout() executed in 5835ms with an avg of 058,350ms
operation doc.Save(pdf, saveOptions) executed in 925ms with an avg of 009,250ms
100 files in 8406ms with an avg of 84ms
Finish running performance tests for ‘100’
Starting generating file ‘20240311-185437.pdf’ …
Info: highlight is not working, images are not rendered
file ‘/…/Aspose.Evaluator.Client18_9_0/bin/Release/net8.0/Output/20240311-185437.pdf’ generated in 48ms
Finish generating file ‘20240311-185437.pdf’

  • Using Aspose.Words version ‘24.3.0’

Starting performance tests for ‘100’ …
operation new Document(wordTemplate) executed in 3180ms with an avg of 031,800ms
operation UpdateXml(doc, xmlBytes) executed in 0ms with an avg of 000,000ms
operation doc.UpdateFields() executed in 70ms with an avg of 000,700ms
operation doc.UpdatePageLayout() executed in 6130ms with an avg of 061,300ms
operation doc.Save(pdf, saveOptions) executed in 6559ms with an avg of 065,590ms
100 files in 16137ms with an avg of 161ms
Finish running performance tests for ‘100’
Starting generating file ‘20240311-203225.pdf’ …
Info: highlight is not working
file ‘/…/Aspose.Evaluator.Client24_3_0/bin/Release/net8.0/Output/20240311-203225.pdf’ generated in 126ms
Finish generating file ‘20240311-203225.pdf’

As you can see, the average generation time for 100 files with the latest version (24.3.0) is 91% slower compared to the older version (18.9.0).

We would like to fully understand these problems and seek your assistance in addressing them to ensure that upgrading and purchasing the license for the new version meets our needs.

Thank you.

@mihai.marin
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): WORDSNET-26714

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.

@mihai.marin We have completed analysis of the issue and did not find any bottlenecks in the code. Yes, the 24.3 version is about 30% slower than 18.9 version in your scenario, but this performance degradation looks acceptable for 6 years of development - news features have been added, improvements in layout algorithm fidelity, etc.
So we decided to close the issue as not a bug.

@alexey.noskov Thank you for your analysis. I’ve noticed a significant performance degradation in my local environment, which appears to be more severe than the 30%. My tests, conducted on a MacBook M2 Max (and the degradation is even more pronounced on a Windows machine), indicate a performance drop of approximately 91%. This level of degradation is considerably higher than expected, and I’m concerned about the impact it may have on our project.

Additionally, I’ve encountered an issue with the highlighting feature not working as intended. Specifically, fields that should be highlighted with a yellow background color, indicating changes made through XML mappings, no longer display this visual indication. You can see in my code how I’m trying to make it yellow.

Could you please provide guidance on the following:

  • How can we address the highlighting issue to ensure that mapped fields are correctly marked?

  • What steps can I take to optimize the performance of my code, aiming to reduce the slowdown to the 30% threshold (the one you consider it acceptable), thereby improving my code performance by 61%?

Thank you for your attention to these concerns. I look forward to your response.

@mihai.marin

Please try using the following code to highlight content in SDT:

Document doc = new Document(@"C:\Temp\in.docx");

foreach (StructuredDocumentTag tag in doc.GetChildNodes(NodeType.StructuredDocumentTag, true))
{
    tag.GetChildNodes(NodeType.Run, true).Cast<Run>().ToList()
        .ForEach(r => r.Font.HighlightColor = Color.Yellow);
}

doc.Save(@"C:\Temp\out.docx");
  1. I have forwarded information regarding performance to our development team. We will keep you updated and let you know once there are news.