Wednesday, March 11, 2009, 3:34:49 PM, Hussein Shafie wrote:
> Daniel Dekany wrote:
>> I edit a ~1MB DocBook 5 XML. Me many others have a good habbit of
>> often unconsciously pressing Ctrl+S. That will block me in work for
>> several seconds; very inconvenient. I wonder what takes so long. Could
>> this process be optimized somewhat? From the footer messages I
>> conclude it's not even the validation, and writing out 1MB of XML,
>> even indented and like, couldn't possibly take so long. (Ideally,
>> saving should happen in parallel with editing, but certainly that
>> would requite copy-on-write capability on the in-memory document
>> representation.)
>> 
>
> Using default options: indentation, references to char. entities, etc,
> saving a 2,274,219 bytes long DocBook 4 document takes less than 600ms
> on my Linux laptop (having a slow disk drive like most laptops).
>
> The problem seems specific to DocBook 5, and more precisely to
> indentation when the document being saved conforms to a RELAX NG Schema.
> If you turn indentation off, you should be able to save your document in
> no time (less than 50ms).
>
> This is clearly a problem, but we currently don't see how to improve the
> performance[*] of XXE in this case and we currently do not plan to save
> documents in a background thread.

I don't quite get what the problem is. Is it that in the most generic
case, an element of a given name can have totally different meaning
("type") depending on what context it occurs? But for most practical
XML schemas you had to indent all elements with the similar name on
the same way, regardless of where it occurs, so just looking up the
element name in a hash would be sufficient. (OK, in some mean schemas,
making a second decision based on the parent elements is needed, but
that's rare anyway, so it shouldn't affect the performance much.) Doesn't
this stand for DocBook 5?

> ---
> [*] Of determining the ``type'' of the element being indented, which is
> different from validation and which is a complex problem to solve in the
> case of RELAX NG.
>
> --
> XMLmind XML Editor Support List
> xmleditor-support at xmlmind.com
> http://www.xmlmind.com/mailman/listinfo/xmleditor-support

-- 
Best regards,
 Daniel Dekany


Reply via email to