[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xalan-c-users
Subject:    Re: ostrstram vs. message callback function
From:       David_N_Bertoni () lotus ! com
Date:       2001-11-15 17:40:32
[Download RAW message or body]


The performance penalty depends on many things, including your platform,
how you're using Xalan, how you're using ostrstream, and the size of the
resulting transformation.

In general, if you don't need to collect the data and send it all at once,
doing a callback will save allocating memory, copying data around, and will
get the results of the transformation incrementally.

Dave



                                                                                               
                    mvasicek@amad                                                              
                    eus.net              To:     xalan-c-users@xml.apache.org                  
                                         cc:     (bcc: David N Bertoni/CAM/Lotus)              
                    11/15/2001           Subject:     ostrstram vs. message callback function  
                    08:53 AM                                                                   
                                                                                               
                                                                                               




Hello Dave,

I would like to ask a question. You wrote:

"...By the way, transforming to an ostrstream can be extremely inefficient.
I suggest you take a look at the callback interfaces in XalanTransformer,
which will allow you to get the results of the transformation directly,
rather than writing it to a dynamically allocated string.  The performance
improvement will be considerable."

I did a simple test on HP-UX 11. I performed 100 transformations using
XalanTransformer.transform(), where the output was either ostrstream or a
callback function. The difference was less than 5%. Is your experience
different from mine?

Best regards, Miro.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic