Re: String.intern() test and measurement

2003-12-04 Thread Peter B. West
J.Pietschmann wrote: John Austin wrote: A high runner in FOP 0.20.5 is: PropertyList.findProperty(). It calls other functions in org.apache.fop.fo that consume significant CPU resources. In one example it called itself recursively to a (depth of 10) Without taking a closer look at the code, I su

RE: String.intern() test and measurement

2003-12-03 Thread Andreas L. Delmelle
> -Original Message- > From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED] > > for(int i= cnt; --i >= cnt; ) sorry. meant 0 cheers, andreas

RE: String.intern() test and measurement

2003-12-03 Thread Andreas L. Delmelle
> -Original Message- > From: Finn Bock [mailto:[EMAIL PROTECTED] > > I can see performance slow down well before 100.000 unique string are > interned. > > > I've attached another demo program that shows that intern'ing is slower > than doing memory sharing with a Hashtable. This programs c

Re: String.intern() test and measurement

2003-12-03 Thread J.Pietschmann
John Austin wrote: A high runner in FOP 0.20.5 is: PropertyList.findProperty(). It calls other functions in org.apache.fop.fo that consume significant CPU resources. In one example it called itself recursively to a (depth of 10) Without taking a closer look at the code, I suspect it tries to find i

Re: String.intern() test and measurement

2003-12-02 Thread Finn Bock
[John Austin] I wondered how much chaining there has to be before performance gets really bad when I checked your program more closely. Your example program would produce external chains of length: 200/20011 ~ 100. I can see performance slow down well before 100.000 unique string are intern

Re: String.intern() test and measurement

2003-12-02 Thread Finn Bock
[Glen Mazza] No I was actually thinking static final variables, my reference to "enumerations" was in a generic sense: public static final int PROPA = 1; public static final int PROPB = 2; public static final int PROPC = 3; That was also what I though you meant. Please accept my apology for missp

Re: String.intern() test and measurement

2003-12-02 Thread John Austin
On Tue, 2003-12-02 at 16:43, Glen Mazza wrote: > --- "J.Pietschmann" <[EMAIL PROTECTED]> wrote: > > > But, as Glenn noticed, the attribute names can > > also be implemented with > > > enumeration > > > > There are no enumerations in pre 1.5 Java. What was > > meant was that > > strings denoting

Re: String.intern() test and measurement

2003-12-02 Thread Glen Mazza
--- "J.Pietschmann" <[EMAIL PROTECTED]> wrote: > > But, as Glenn noticed, the attribute names can > also be implemented with > > enumeration > > There are no enumerations in pre 1.5 Java. What was > meant was that > strings denoting XSLFO property enumeration tokens > can be interned > as the se

Re: String.intern() test and measurement

2003-12-02 Thread John Austin
On Tue, 2003-12-02 at 14:04, J.Pietschmann wrote: > Finn Bock wrote: > >> new DefaultMutableTreeNode(("Attribute (name = '" + > >>atts.getLocalName(i) + > >>"', value = '" + > >>

Re: String.intern() test and measurement

2003-12-02 Thread John Austin
On Tue, 2003-12-02 at 12:59, Finn Bock wrote: > I'm resending this mail since it hasn't yet shown up in the archives. > I'm sorry about any duplicates. > > [John Austin] > > > 4) Changed the handling of strings at the for-loop storing the > >attributes received from the parser in startElemen

Re: String.intern() test and measurement

2003-12-02 Thread J.Pietschmann
Finn Bock wrote: new DefaultMutableTreeNode(("Attribute (name = '" + atts.getLocalName(i) + "', value = '" + atts.getValue(i) + "')").intern() ); Here y

Re: String.intern() test and measurement

2003-12-02 Thread Finn Bock
I'm resending this mail since it hasn't yet shown up in the archives. I'm sorry about any duplicates. [John Austin] 4) Changed the handling of strings at the for-loop storing the attributes received from the parser in startElement( ... ) // Process attributes for (int i=0; i

String.intern() test and measurement

2003-12-01 Thread John Austin
I decided to find a demonstration program that works similar enough to FOP that I could try the String.intern() technique. 1) SAXTreeValidator.java from Chapter 3 of Brett McLaughlin's "XML and Java" the online copy of the example is 2nd Ed. 2) Fed this program various fragments of .fo files I