[Twisted-Python] Surprises in twisted.web.woven

Dave Smith dizzyd at jabber.org
Mon Aug 4 15:04:42 MDT 2003


On Monday, Aug 4, 2003, at 11:28 America/Denver, Glyph Lefkowitz wrote:

>
> On Monday, August 4, 2003, at 07:13 AM, Tim Allen wrote:
>
>> Is there any reason why white-space preserving should not always be 
>> on?
>
> Believe it or not, it's a bottleneck.
>
> In order to preserve whitespace, you have to create a bunch of extra 
> Node and str objects, which consume a not-inconsiderable set of 
> resources for, let's say, a directory full of reasonably sized Woven 
> templates.

This "bottleneck" is highly dependent on your DOM _implementation_. 
Many DOMs normalize adjacent sections of text/CData to avoid this exact 
issue. It should be a relatively simple fix to the MicroDOMParser to 
avoid extra nodes on adjacent CData sections.

<shameless-plug>You could always look at xish.domish.Element.addContent 
as an example. ;) </shameless-plug>

Diz





More information about the Twisted-Python mailing list