users@fi.java.net

Re: JAXB Speed

From: Alan Hudson <giles_at_yumetech.com>
Date: Tue, 06 Feb 2007 13:04:33 -0800

Paul Sandoz wrote:

> Hi Alan,
>
> As part of the Japex project [1] there are drivers to measure the
> performance of JAXB marshaling and unmarshaling.
>
> I am not sure of the exact change you mention but JAXB 2.0 is very
> customizable so i am sure it is possible to support primitive types.
> If you send more details i might be able to help you.
>
I have that feeling but haven't done the total dillegence on it.
Ideally I'd find an example which forced all primtive usages in a
schema. I suspect its not
just a global flag but basically a schema override on each field. I
might proposed back an implementation change that provides that global
flag. Worst case I'll write my own code generator backend which is
supported by the spec.

> An important note: if you are using JAXB 2.1 then you must use FI
> 1.2.x rather than FI 1.1.x. The reason being is FI 1.2.x has
> optimizations for serialization that are utilized by JAXB 2.1.
> Unfortunately we have not had the time to integrate types other than
> byte[] in JAXB. IMHO to do this properly requires type-based
> extensions to the StAX API. I have been talking about it for ages :-(
> my eyes are bigger than my stomach!
>
I think I'm on 1.2 as I'm using CVS head for FI. Or is 1.2 currenlty a
branch? Still working out the plan but I expect I can help. We now have
our benchmark numbers for straight JAXB 1. I'll run the same tests for
2.1 and then figure out our workplan.

> For external vocabularies: if you set the vocabulary of the FI StAX
> parser/serializer explicitly then use that parser with JAXB then you
> should be OK. BTW if your underlying protocol is 'stateful' then you
> can also dynamically share the vocabulary that is the result of
> parsing individual documents. This can be a nice trick to reduce the
> size without depending on schema.
>
agreed. I didn't see how to do it yet but I'll find the right hooks...
I know they are there but I didn't see it last check.