Tabs in DITA <pre> tag cause slow rendering in Author View

Post here questions and problems related to editing and publishing DITA content.
sanGeoff
Posts: 42
Joined: Mon Aug 18, 2014 11:50 pm

Tabs in DITA <pre> tag cause slow rendering in Author View

Post by sanGeoff »

Hi, I just noticed a performance issue today. We have a long DITA topic with a <pre> tag of about 1,500 lines and had about 3,000 indent tab characters in it. When opining the file in oXygen (Author View) it was taking about 100 seconds to load and open. After replacing all the tabs with spaces the file loads in less than 2 seconds.

It's not a big deal since its just one file, just thought I would post about it and was kinda wondering why a character would cause such a performance change. The files is actually bigger with 4 spaces instead of tabs.

I didn't test to see if the growth rate was liner or not but I wonder how much it affects smaller amounts of tabs in other files and tags as well. It may not be as noticeable if there are say 200 tabs in a file, but it may be something you might look into.

PS: what happened to the add attachment and insert image on the forum?
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Tabs in DITA <pre> tag cause slow rendering in Author Vi

Post by Radu »

Hi,

I can confirm that when the XML content has actual tab characters inside it, the layout of the visual editing area needs more time to be performed. The problem is that tabs have variable widths depending on the text in which they appear so whenever tabs are encountered in the content Oxygen slows down in order to compute each individual tab width, basically it's trading performance for visual correctness.
We'll look more into this, try to see if we can make it more efficient.
Besides replacing the tabs with spaces, one other idea would be to use a DITA <codeblock> in which you can add a DITA <coderef> which points to a file containing the text content, thus keeping the text content separate from the DITA content.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Tabs in DITA <pre> tag cause slow rendering in Author Vi

Post by Radu »

Hi,

Just to update the thread, we fixed this performance problem in Oxygen 17.0.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply