Accepting Multiple Revisions is very slow

Dear Aspose Team,

I have a large Word document with a lot of revisions (Document.Revisions.Count > 22 000). Now I want to accept all Revisions that are older than e.g. 7 days.

That is why I cannot use the acceptAllRevisions() function.
Iterating over all revisions in one go also does not work, I either get an Exception from the RevisionsCollection or the Word document is broken afterwards (if I copy the revisions into a separate list).

The only way I got it working was to only take one item from the RevisionsCollection at a time and accepting that:

Revision r = doc.getRevisions().get(0);
while (r != null)
{
    r.accept();
    try
    {
        r = doc.getRevisions().get(0);
    }
    catch (Exception e)
    {
        r = null;
    }
}

That way I could check the dates in there.

BUT, this is extremely slow, it takes multiple minutes to process the 20k revisions.
Is there a better way to do that?

@dominikh05 Please, attach the source document here to evaluate the issue complexity. It’s safe. Your attachments can be downloaded only by you and Aspose staff. We will check it and provide you more information.

anonymous_aspose.zip (336.1 KB)

See attached. I had to remove the information in the document but the revisions are still intact.

@dominikh05 Thank you for additional information. We will need additional time to perform performance tests.

@dominikh05
Thank you for reporting this issue to us. I have logged it as WORDSNET-23930. We will keep you informed and let you know once it is resolved.

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