Thanks for the info. Moving to the latest and make using of the select
attribute for <xsl:variable> instead of nested value-of reduced the clones
tremendously.

As a follow up (and strictly FYI), about 10% of the time is spent now in
each of the both StringBuffer.expand() and String.intern. The latter does
not bother me too much, but the former does as Buffer's are synchronizd and
I was using Transformer which I assume to be used by one and only one
thread. I did a quick move to XSLTC (which was also much easier on the
nightly build.. thanks!) and saw that it appeard to be slower with 10
concurrent threads. Seems like alot of time was spent building a DOM and
initing Vectors and Hashtables.

-- bk

>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, May 28, 2002 8:07 AM
>> To: Bryan Kearney
>> Cc: '[EMAIL PROTECTED]'
>> Subject: Re: What causes object cloneing?
>> 
>> 
>> 
>> I think generally, you're seeing the cloning coming from the 
>> iterators.
>> Each iterator (for instance "foo/baz" would create an 
>> iterator) holds it's
>> own state, and therefore has to be cloned.  We've tried 
>> things like object
>> pooling to decrease the cloning, but it's really not cheaper 
>> than cloning.
>> We've also done some things to decrease when you need a full 
>> clone... for
>> instance <xsl:value-of select="foo/baz"/> only finds the 
>> first object, so
>> should only need one instance per process.  But you still 
>> have to reset the
>> iterator each time.
>> 
>> Using the iterator model gives Xalan it's incremental processing
>> characteristics.  The other model is to just use vectors, 
>> and create a
>> vector every time, but then you have to find all the nodes 
>> at once.  This
>> is what XalanJ 1.x did.  Besides killing incrementality, 
>> you'll find you
>> spend an similar amount of time (well, maybe half) creating 
>> vector objects.
>> 
>> A fully compiled model (XSLTC) can probably decrease the 
>> amount of cloning
>> needed for the iterator model by a lot (75%?).
>> 
>> You might try the most recent version of CVS, and see how 
>> your profile
>> changes.  We've done a fair amount of performance tuning in 
>> the last couple
>> of months, including redundent expression elimination, and 
>> some elimination
>> of cloning, which may help you a lot.  We've still got a 
>> couple of bugs to
>> kill before we do a release (and I've been too busy lately to do a
>> developer's release myself).
>> 
>> -scott
>> 
>> 
>> 
>> 
>>                                                              
>>                                                              
>>              
>>                       Bryan Kearney                          
>>                                                              
>>              
>>                       <[EMAIL PROTECTED]        To:       
>> "'[EMAIL PROTECTED]'" 
>> <[EMAIL PROTECTED]>               
>>                       .com>                    cc:       
>> (bcc: Scott Boag/Cambridge/IBM)                              
>>                  
>>                                                Subject:  
>> What causes object cloneing?                                 
>>                  
>>                       05/28/2002 09:50                       
>>                                                              
>>              
>>                       AM                                     
>>                                                              
>>              
>>                                                              
>>                                                              
>>              
>>                                                              
>>                                                              
>>              
>> 
>> 
>> 
>> 
>> I am profiling xalan j 2.3.1 and I have noticed that 20+% of 
>> my time is
>> spent in Object.clone(). Given that my CPU is pegged with 5 
>> concurrent
>> transformations, I am guessing that the heap allocation, and 
>> therefore the
>> cloneing, is causing most of the pain. What in the 
>> stylesheets causes a
>> clone?
>> 
>> Thanks in advance.
>> 
>> -- bk
>> 
>> 
>> 
>> 
>> 

Reply via email to