commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig McClanahan" <>
Subject Re: [httpclient_common]_why httpclient's speed is the same with JDK httpurlconnection
Date Wed, 07 Feb 2007 05:46:16 GMT
On 2/6/07, allen huang <> wrote:
> Hi,
> I have a problem when trying to comparing the speed between JDK
> HttpURLConnection and HttpClient.
> Now I have two methods, one is performed with jdk(1.5) httpurlConnection,
> the other is performed with httpClient( 3.0.1). Both of them try to
> download
> the same webpage(<
> the average time which performed JDK httpurlconnection  is  200ms,
> so as the one which performed httpclient.That means their speeds are
> almost
> the same.
> So, since HttpClient use persistence connection default but JDK do not,
> why
> httpClient's speed could not be more fast than JDK?

What JDK are you using?  IIRC, the JDK's HttpUrlConnection class has
defaulted to persistent HTTP connections since at least JDK 1.1 days.

Another problem is, is it normal to httpclient to use 200ms to download a
> page like I mean, when using persistence
> connection, maybe this could not be accepted.

The timing of something like this, especially on a relatively small page, is
going to be so dominated by the speed of your connection to the Internet
that "acceptable" is in the eyes of the beholder.  Is it fast enough for
your requirements?  If so, it doesn't matter which technology you choose --
they both work.  Is it too slow?  Then it doesn't matter which technology
you choose -- they both fail to meet your needs.  Is your average need to
download multiple megabytes instead of a couple hundred kbytes?  Then the
test you ran is totally meaningless because it did not reflect your real

Any help will be great appreciated


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message