Performance of the New Table of Contents UpdateFields/UpdatePageLayout Feature

As mentioned in previous post we were excited by the introduction of the new TOC generation feature in Aspose and were looking forward to putting it to good use. However we have run in to some serious performance issues that presently will result in dumping what otherwise would be a great feature.
The attached large document report ‘Testin.docx’ was generated and saved to disc as part of our report generating process within 20 seconds using the latest Words Aspose 9.0.
The performance problems start however once we add code to generate the TOC. For example running the following simple code on the attached document produces the following results:

Document doc = new Document(@"TestIn.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
Debug.Write(DateTime.Now + " START UPDATE FIELDS\n"); 
builder.Document.UpdateFields();
Debug.Write(DateTime.Now + " START UPDATE PAGE LAYOUT\n"); 
builder.Document.UpdatePageLayout();
Debug.Write(DateTime.Now + " START SAVE\n");
builder.Document.Save(@".\Testout.docx");

13/05/2010 18:10:19 START UPDATE FIELDS
13/05/2010 18:11:01 START UPDATE PAGE LAYOUT
13/05/2010 18:11:31 START SAVE

It takes 42 seconds to update the fields and then another 30 seconds to update the page layout. This results in adding 72 seconds to report generation just for the sake of adding a TOC. Remember original report only takes 20 to build and save.
(Note: For Comparison it does takes Microsoft Word approx 25 seconds to update the TOC in this document.)
Therefore can Aspose advise on any of the following:

  1. Is there anyway of speeding up the TOC generation process?
  2. I tried calling UpdateFields on the Paragraph.Range that contained the TOC but this did not seem to work and the TOC was not updated?
  3. What is going on whithin Update Fields/Update Page Layout that takes so long? Is there anyway I could change my document styles TOC definition that would speed up this process?
  4. Are aspose aware of this problem? Are there any plans in progress to improve the performance of this feature?

Thanks and Regards
Daniel Finkelstein
Senior Software Engineer - HP Software

Hi

Thanks for your inquiry. We will consider an ability to speedup fields updating process. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
Regarding updating page layout, your document contains 526 pages. Aspose.Words builds 10 pages layouts per second. So the average time of updating page layout of your document is 50 seconds.
Best regards.

Hi,
We’ve done testing for your document.
It actually looks to us that the time it takes to perform Document.UpdatePageLayout is quite good. On my machine it takes only 12 seconds to layout a 526 pages document. We have found ways to improve UpdatePageLayout speed, but it will not be major improvement this time. Maybe up to 10%.
But we see that UpdateFields in this case is taking a lot longer than it should. We think there is a problem there and we are looking to fix it, hopefully cutting this time significantly.
We expect a fix for this will be included in the 9.2 release end of June.

The issues you have found earlier (filed as 17460) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as WORDSNET-3504) have been fixed in this .NET update and in this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.