Keith
After trying with our real application following are the results:
original time to unmarshal an xml message: 211ms
after using existing ClassDescriptorResolver time to unmarshal an xml message:
35ms
When we tried with Piccola parser instead of xerces with caster the time to
unmarshall went down to 25ms. This change really helped us in performance with
our application. Another important improvement with this change is cpu
utilization of process also went down to 15% from 100% when we need to process
thousands of these xml message in small interval.
What I would like to know is does "cdr" instance is thread safe and can be
shared by multiple Unmarshaler instances in multithreaded application. Also what
about the Unmarshaler instance does it thread safe.
Thanks for your help in this regard.
Ramesh
Keith Visco wrote:
> No problem. Just let me know if you need any more help.
>
> --Keith
>
> Ramesh Vishwanatham wrote:
> >
> > Keith
> > Thanks for your help in this regard. I had a problem with my email and only
> > got to see your email today. I tried on smaller test case and it showed
> > improvement and we are going to try in our real code soon and test it.
> > Ramesh
> >
> > Keith Visco wrote:
> >
> > > Ramesh,
> > >
> > > How are you calling the Unmarshaller?
> > >
> > > I'm not sure if you're already doing this, but try caching the
> > > ClassDescriptorResolver:
> > >
> > > import org.exolab.castor.xml.ClassDescriptorResolver;
> > > import org.exolab.castor.xml.util.ClassDescriptorResolverImpl;
> > >
> > > ...
> > >
> > > ClassDescriptorResolver cdr = new ClassDescriptorResolverImpl();
> > > ...
> > >
> > > ///-- somewhere inside your loop for listening on your socket
> > > Unmarshaller unmarshaller = new Unmarshaller(Foo.class);
> > > unmarshaller.setResolver(cdr);
> > >
> > > Hope that helps, if not...we'll probably need to see some sample code.
> > >
> > > --Keith
> > >
> > > Ramesh Vishwanatham wrote:
> > > >
> > > > Hi
> > > > We are using castor's api (source code generated from xml schema) to
> > > > send xml data over tcp sockets. we are having problems with performance
> > > > to unmarshall large amount (order of one thousand messages in short
> > > > interval) xml messages. Unmarshal of each xml message is taking an
> > > > average of 200 milli seconds. Following are the details:
> > > >
> > > > castor version: 0.9.3.9
> > > > os : hpux 11i
> > > > java version: jdk1.3.1.09
> > > > xml parser: xerces 1.4.3j
> > > > org.exolab.castor.builder.javaclassmapping=type // other than change we
> > > > use other default option to generate code
> > > > message length: 1250 (approx)
> > > >
> > > > Is there any way we can improve the unmarshaling performance. Thanks in
> > > > advance.
> > > >
> > > > Ramesh Vishwanatham
> > > >
> > > > -----------------------------------------------------------
> > > > If you wish to unsubscribe from this mailing, send mail to
> > > > [EMAIL PROTECTED] with a subject of:
> > > > unsubscribe castor-dev
> > >
> > > -----------------------------------------------------------
> > > If you wish to unsubscribe from this mailing, send mail to
> > > [EMAIL PROTECTED] with a subject of:
> > > unsubscribe castor-dev
> >
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> > unsubscribe castor-dev
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev