Hi Andreas,

Furtner, Andreas wrote:
> Hello,
> 
> I have a question regarding the usage of Castor in a multi-threaded,
> high volume use scenario like explained in
> http://www.castor.org/xml-best-practice.html#Performance-Considerations
> 
> We use Castor with a lot of mapping (XML) files - one for each class we
> want to serialize.
> 
> In such a scenario, should I use
> 1) ONE XMLContext with all the mapping files added to it, or is it
> better to
> 2) use another XMLContext with each mapping file?
In my opinion, you should use one XMLContext() instance only.

> As I read in other postings in the list (1) should be the prefered way,
> but because it would be unconvenient to initialize XMLContext with all
> possible mappings,
> we use a lazy on-demand approach. So:
> 
> Is it safe to call XMLContext.addMapping() with the same mapping twice?
It should be, as far as I remember.

> Will XMLContext then cache the mappings in calls to
> XMLContext.addMapping() and return fast? 
> 
> Or should we cache used mappings ourselves and prevent another call to
> XMLContext.addMapping()?
Can you provide me with a *small* but complete test case that shows the
problem at hand ?

> We noticed, that the overhead of initialization and setting mappings is
> much bigger than the actual (de)serialization work afterwards. So I'd like to
> keep it as low as possible.
> 
> Thanks a lot,
> Andreas Furtner
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to