<html><body>
<p><tt>&gt;&gt;&gt;Jason just moved JDOMFactory out of package org.jdom.input and into<br>
org.jdom&lt;&lt;&lt;</tt><br>
<tt>This is great.</tt><br>
<br>
<tt>&gt;&gt;&gt;But I don't see how the static addContent methods help&lt;&lt;&lt;</tt><br>
Well, in case of Attribute, there is a check for duplicate attribute. And in case of Element, there are other checks, like parents,  canContains()... etc.<br>
I just wanted to skip these tests, as they are useless.<br>
<br>
<tt>&gt;&gt;&gt;INITIAL_ARRAY_SIZE&lt;&lt;&lt;</tt><br>
<tt>This can effectively be a performance bottleneck. In some cases, you may know in advance the number of children (ex: generated code, XMLS like serialization...) and having a ctor which takes it as a parameter can help optimize the performance and the memory.</tt><br>
<br>
Phil.<br>
<br>
<img src="cid:00__=4EBBE4ADDFF3A5658f9e8a93@triloggroup.com" width="16" height="16" alt="Inactive hide details for &quot;Bradley S. Huffman&quot; &lt;hip@cs.okstate.edu&gt;">&quot;Bradley S. Huffman&quot; &lt;hip@cs.okstate.edu&gt;<br>
<br>
<br>

<table V5DOTBL=true width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img src="cid:10__=4EBBE4ADDFF3A5658f9e8a93@triloggroup.com" border="0" height="1" width="72" alt=""><br>
</td><td style="background-image:url(cid:20__=4EBBE4ADDFF3A5658f9e8a93@triloggroup.com); background-repeat: no-repeat; " width="1%"><img src="cid:10__=4EBBE4ADDFF3A5658f9e8a93@triloggroup.com" border="0" height="1" width="220" alt=""><br>

<ul>
<ul>
<ul>
<ul><b><font size="2">&quot;Bradley S. Huffman&quot; &lt;hip@cs.okstate.edu&gt;</font></b>
<p><font size="2">18/02/2004 18:08</font></ul>
</ul>
</ul>
</ul>
</td><td width="100%"><img src="cid:10__=4EBBE4ADDFF3A5658f9e8a93@triloggroup.com" border="0" height="1" width="1" alt=""><br>
<font size="1" face="Arial">        </font><br>
<font size="2">        To:        </font><font size="2">phil@triloggroup.com</font><br>
<font size="2">        cc:        </font><font size="2">jdom-interest@jdom.org</font><br>
<font size="2">        Subject:        </font><font size="2">Re: [jdom-announce] JDOM Beta10 released</font></td></tr>
</table>
<br>
<br>
<tt>phil@triloggroup.com writes:<br>
<br>
&gt; I'm very pleased to see that JDOM is being officially released soon. Mo=<br>
&gt; reover, it features new capabilities like Content class that will make =<br>
&gt; our work easier!<br>
&gt;<br>
&gt; I still have just one concern with the API, that forces us to provide o=<br>
&gt; ur own build to customers. It's about optimization, when you want to co=<br>
&gt; nstruct a DOM without going through any validation stuff, because you p=<br>
&gt; erfectly know that your DOM is valid. Typically, we currently do this w=<br>
&gt; hen building an HTML tree programmatically (the build class is machine =<br>
&gt; generated from HTML source). <br>
&gt; We already spoke about this earlier, and I want to reanimate the debate=<br>
&gt; because it may gain up to 20/25% execution speed. <br>
&gt;<br>
&gt; You'll find a copy of the changes I made and now working with Beta 9 in=<br>
&gt; &nbsp;production. To please Eliott and prevent people from doing something b=<br>
&gt; ad, all these &amp;quot;unverified&amp;quot; methods must be called as static m=<br>
&gt; ethods from UnverifiedFactory class. I joined to the mail the pieces of=<br>
&gt; &nbsp;code that does the trick. &nbsp;Nothing changed in the API, it is just an a=<br>
&gt; dd-on.. Because of class scopes, there is now way to make it running wi=<br>
&gt; thout providing a custom build. <br>
<br>
Jason just moved JDOMFactory out of package org.jdom.input and into<br>
org.jdom so users can have a custom factory to skip verification from<br>
trusted sources, so that pretty much eliminates the need for the extra<br>
createElement, etc. methods. &nbsp;And since it has moved, putting a &quot;fast&quot;<br>
version of JDOMFactory in contrib would probably be a good idea at this<br>
point.<br>
<br>
But I don't see how the static addContent methods help. &nbsp;Elements can have<br>
anything as children except a DocType so all your skipping is one instanceof<br>
test and a check for a null parent. &nbsp;But the potentially biggest time waster,<br>
reallocation of the content array, remains intact. But that assumes the<br>
number of children in most of a document's elements greatly exceeds the<br>
INITIAL_ARRAY_SIZE and causes excessive array reallocation. Something only<br>
profiling can support or disprove, and then only on a case by case bases.<br>
<br>
One problem I do see, which falls under the TODO item &quot;ensure JDOM is<br>
appropriately tweaked for subclassing&quot;, is if your problem would benefit<br>
from a larger INITIAL_ARRAY_SIZE, I don't see a easy to do it currently.<br>
<br>
Brad<br>
------------------------------------------------------------<br>
Mail was checked for spam by the Freeware Edition of No Spam Today!<br>
The Freeware Edition is free for personal and non-commercial use.<br>
You can remove this notice by purchasing a full license! To order<br>
or to find out more please visit: </tt><tt><a href="http://www.no-spam-today.com">http://www.no-spam-today.com</a></tt><tt><br>
</tt>

</body></html>