General XMetaL Discussion
jrob61 October 16, 2012 at 1:22 pm
How to speed up Open, Edit, and SaveOctober 16, 2012 at 1:22 pmParticipants 0Replies 1Last Activity 9 years, 11 months ago
Trying to speed up the time it takes for xmetal7 to (a) open a 1000 page document, and (b) edit without noticeable delays, and (c) save .xml file, all within a “reasonable” time.
•Regarding Open, able to speed up process by reducing the total number of tags; .xml file opens in 14 seconds, but desire 5-10 seconds.
•Regarding Editing, avoid calstable and removed certain .css properties known to cause slowness (display: pre & background-color); these approaches for the most part have been successful.
•Regarding Save, taking 25 seconds, but desire 5-10 seconds?
1. Looking for insight on what else can speed up the Open and Save processes. Tried setting ‘Rules Checking Off’ and turned off validation in the xmetal70.ini without any noticeable difference.
2. Is it feasible to utilize the structure view and override its click event to only show in the activedocument window the xml range that was clicked (by using .css display: none in the activedocument window)? This property does speedup the Open process, however using structure view still takes same 14 seconds on the File/Open – so not sure if gaining anything using this approach?
3. Is there any ini setting to collage all tags upon file/open (hoping this may speed up the File/Open if takes less time to paint to the screen)?Derek Read October 16, 2012 at 6:52 pm
Reply to: How to speed up Open, Edit, and SaveOctober 16, 2012 at 6:52 pm
Is your “edit” step is automated? i.e.: No human author involved, but using script and perhaps working on many files? I'm getting that feeling. If so, you could hide everything except the root element at open (using display:none for * or even selected elements below root) and still be able to manipulate the XML using all of the XMetaL APIs (using Range or DOM, Selection won't work because it can only do what an author can do).
If not, then optimizing anything will depend on the needs of your authors so giving a specific answer is going to be difficult I think.
Turning off Rules Checking may speed some things up, but again, you will most likely want to leave that on when authors are editing files.
Closing the Attribute Inspector can speed things up in some cases as well.
There is no INI setting for collapsing tags when a document is opened, but you could write a script to do it. I'm not sure this will help much though. In order for an author to do anything with the document they'll need to expand the elements and then a full render will occur (which defeats the purpose of collapsing them in the first place). So, I think this would only be useful if you are manipulating the document using script, and CSS display:none is probably an easier and possibly better option anyway.
You could try something similar to this though:
//collapse tags for root element
var docNode = ActiveDocument.documentElement;
var rootElem = ActiveDocument.Range;
rootElem.CollapsedContainerTags = true; ]]>
If you are manipulating the content via scripting (no humans involved at all) then we might have an option for you in the future. The new “Find in Files” and “Spellcheck in Files” in XMetaL Author 7.0 use an “invisible” copy of XMetaL Author (an ActiveX version) to load files without rendering them. There is a third option that we have provided some examples for (accessible via Tools > Run Cross-File Operation) but how to build these “operations” has not yet been documented and the feature isn't really finalized yet. It might be something to consider for the future though. Essentially it allows you to load a document, or multiple documents, into an invisible copy of XMetaL without rendering them (so saving all that overhead) while still providing access to Range, DOM and most Document object APIs to work on the file(s).
- You must be logged in to reply to this topic.