users@jaxb.java.net

Re: Cost of creating Marshallers, Unmarshalers and ObjectFactory

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Fri, 2 Nov 2007 15:12:15 +0100

Hi.

> I was wondering if there is a significant cost to creating Marshallers,
> Unmarshalers and ObjectFactory instances in JAXB RI.
> Ideally I would like to only cache the JAXBContext and reuse it. Is
> there any point in caching Marshallers, Unmarshalers and ObjectFactory
> as well?

I would not recommend caching Marshallers and Unmarshallers since they
are not guaranteed to be thread-safe.
Normally I only cache JAXBContext. I think creating marshallers and
unmarshallers is not that heavy.

Bye.
/lexi