Hi,
We are using Xalan-C++ version 1.10 in an app which spends almost all its
time in doing xsl transfomations. I am looking to optimize its performance
if possible.
The app applies a compiled stylesheet repeatedly on input "strings" that are
about 5k long and produce and xml output that is also about 5k long.

1) The input string looks like this <<?xml version="1.0"><dummyroot>LONG
XMLENCODED STRING</dummy root>
2) stylesheet converts the input to a "proper" xml output". The logic in
style sheet is bunch of if and substr statements. like this

 ....     <!-- sample snippet from style sheet -->
                <AccountNumber>
                    <xsl:value-of
select="normalize-space(substring(.,2058,10))"/>
                </AccountNumber>
                 <xsl:if
test="string-length(normalize-space(substring(.,9,12)))>0">
                    <MyIdentifier>
                        <xsl:value-of
select="normalize-space(substring(.,9,12))"/>
                    </MyIdentifier>
                </xsl:if>

3) This is running on sun solaris and a typical analyzer output shows
xalanc_1_10::XalanVector<unsigned
short,xalanc_1_10::MemoryManagedConstructionTraits<unsigned short>
>::insert(unsigned short*,const unsigned short*,const unsigned short*)
takes 27.109 (76.33%) of User time. which is being called from
xalanc_1_10::FunctionSubstring::execute(xalanc_1_10::XPathExecutionContext&,xalanc_1_10::XalanNode*,const
xalanc_1_10::XObjectPtr,const xalanc_1_10::XObjectPtr,const
xalanc_1_10::XObjectPtr,const xercesc_2_7::Locator*)const

Note that stylesheet does have lot of substring calls so code should spend
most of the time there.


Best,
HB.

Reply via email to