Categories > OpenTBS with DOCX >

extremely slow docx building

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: hemocyanin
Date: 2013-12-05
Time: 20:42

extremely slow docx building

Using tbs 3.8.2 and openTBS 1.8.1 (or 3.7.0 and 1.7.5), creating a docx is extremely slow.  The template is like a tax form -- a seven page table.  All of the math is done PHP side.  Only onshow and mergeblock are used.

I've been having trouble with this template for some reason, both as a docx and as an odt, though I can get it to build in about 4 seconds as an odt using the 3.7.0 and 1.7.5 combination (30+ seconds as an odt with 3.8.2 and 1.8.1).

For docx, no matter what versions I use, it is taking more than a minute.  I've tried using the native XML tags for word, e.g., w:p, w:tr and the newer method (with 3.8.2 and 1.8.1), e.g., tbs:p, tbs:row -- that made no noticeable change.

I'm sort of at a loss for where to look for solutions.  I would appreciate any suggestions. 
By: hemocyanin
Date: 2013-12-09
Time: 23:40

Re: extremely slow docx building

Some experimentation improved things a alot.  I'd still like it to be faster, but it is at the edge of tolerable.  Note that this is for a very complicated multipage table document with merged and split cells, some static content, some simple variables, and a lot of table rows that come out of arrays.

Initially, it took more than a minute to build the document.  When I looked at the document's xml, I noticed that there was a lot of junk mixed in with the data fields related to spelling, grammar, and undo.  I went to the MS Word Options and turned off every single formatting and error checking aid I could find.  This stuff gets embedded.  I also went to the trust center and unticked the "store random numbers to improve combine accuracy".  This took a bunch more garbage out the xml (the purpose is for keeping track of different people's edits when collaborating on documents).

This got me to the point where the document would build in about 10 seconds (using tbs 3.8.2 and openTBS 1.8.1).  I can get this down to 7 seconds when I build the documents using tbs 3.7.0 and openTBS 1.7.5.  Ideally, I'd like to see build times in the 2-3 second range, but I'm not sure what else I can do to improve performance.

By: Skrol29
Date: 2013-12-13
Time: 02:45

Re: extremely slow docx building

Hi Hemocyanin,

There is special FAQ about optimizing the merging:
http://www.tinybutstrong.com/support.php#faq_slow

If you need more help, I can have a look at your template.