users@jersey.java.net

Re: [Jersey] Client: Performance: InputStream fastest possibility?

From: Johannes Schneider <mailings_at_cedarsoft.com>
Date: Thu, 23 Sep 2010 10:51:51 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/23/2010 12:00 AM, Paul Sandoz wrote:
>
> On Sep 18, 2010, at 10:44 AM, Tatu Saloranta wrote:
>
>> On Sat, Sep 18, 2010 at 10:18 AM, Johannes Schneider
>> <mailings_at_cedarsoft.com> wrote:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Hi guys,
>>>
>>> at the moment I try to optimize some code that fetches a large JSON
>>> document. I am using the Client provided by Jersey.
>>>
>>> At the moment I am calling
>>>> resource.getEntity( InputStream.class )
>>>
>>> My profiler shows me, that the Jackson parser has to wait for the stream
>>> (in HttpInputStream#read) for a long time...
>>
>> Sounds like maybe it is being buffered (read completely into in-memory
>> buffer) before being handed to Jackson?
>>
>
> Jersey will not buffer the response entity unless you have Jersey
> logging enabled (using a filter).
>
> Are you using the Jersey client with HttpURLConnection or the Apache
> HTTP client?

I just instantiating the Client without any args. So I think it should
use a com.sun.jersey.client.urlconnection.URLConnectionClientHandler

But don't exactly know the difference between the two options you
mentioned...


Johannes

>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>

- --
Johannes Schneider - blog.cedarsoft.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJMmxUnAAoJEAytD9R7Qv6dtcgIAI6UAkUqxonLX3zNhTW2KTBo
t9C4S1010tSZH30OGbySbO59H07c/1I0HfFiLRhf4mQv+JAlLUwxB7DcOplykv/9
nGb5py2dqoo8xdTAXRIVrZDPZKWydDLCywx1hoxG+5fgRb6P7r1370BqCNadp5oC
sq6b8+xjHj+lKu2hLTc5T8bdPjjOzFXRR8sDLp8OzUFTl+npHghPFm1DvXYpEIkk
wDpQekNX06GVdM2CmVncJ/vVFfSlUvsLM5OVNUSLn5kgruzbaG8g/aaNnXEV9Vp5
RO4HDkWQXlp5Osv22Bc3ZMBMoX24fXuLtEyJ5rlke6r8d3xqNorVw6EKMnpBhWk=
=OPsS
-----END PGP SIGNATURE-----