Exporting each math node separately using toString() takes significant amount of time

Hi Team,

I have a requirement where I have to export each OfficeMath node separately and I am using the following to extract the mathml from the node

HtmlSaveOptions options = new HtmlSaveOptions();
options.setOfficeMathOutputMode(HtmlOfficeMathOutputMode.MATH_ML);
String math = officeMath.toString(options);

And I have noticed that each time toString method is called it will take from 500ms to 1500ms on my machine to complete which will take a long amount of time to process a 100 math node for example.

On the other hand (using the same sample) calling toString() method on the whole Document object would take only around 2000ms

Document doc = new Document("sample.docx");
HtmlSaveOptions options = new HtmlSaveOptions();
options.setOfficeMathOutputMode(HtmlOfficeMathOutputMode.MATH_ML);
doc.toString(options); 

In short I wonder what is the optimal way to extract math_ml from officeNode without significantly impacting performance?

@IhabYaseen We have also noticed that conversion OfficeMath to string takes much time. The problem is logged as WORDSNET-24561 and is already scheduled for development. We will keep you informed and let you know once it is resolved.
Unfortunately, there is no other way to convert OfficeMath to MathML string.

The issues you have found earlier (filed as WORDSNET-24561) have been fixed in this Aspose.Words for Java 23.3 update.