users@jersey.java.net

Re: [Jersey] Custom inject provider

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Mon, 29 Jun 2009 23:52:17 -0700

On Mon, Jun 29, 2009 at 12:23 PM, Guba, Nicolai<nguba_at_bioware.com> wrote:
> You don't have to use JAXB at all.  You can just obtain the request as String and then unroll your own object.

Or, for better efficiency, InputStream.

> We have actually measured the impact of this and the results have shown about a 16% overhead of Jackson unmarshalling vs the good ol JSONObject (go figure!  I thought Jackson was meant to be quicker).

That would be most unexpected result. :-)

Do you happen to have a simple test case at hand to exhibit this
behavior? Or maybe a code snippet?

And yes, Jackson is meant to be faster. Usually by factor of 4x or 5x,
from feedback I have gotten. I haven't seen any case where default
JSONObject would come anywhere near it, speedwise, so I would be
interested in seeing what gives results you are seeing.,

> If raw protocol speed is of essence, then looking at fast infoset may be a better alternative.  As far as we are concerned, we have benchmarked our request handling in the region of 16-17k requests per second per server---which is most adequate.

From what I have seen, FI is actually not necessarily faster than JSON.
It can be bit faster than plain old textual XML overall (slower to
write == serialize, faster to read), but it's really important to
measure things to know for specific use cases. FI has bit higher
per-invocation overhead it seems, so benefits are bigger for larger
documents.

-+ Tatu +-