Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 5445 invoked from network); 7 Feb 2007 05:46:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2007 05:46:45 -0000 Received: (qmail 4512 invoked by uid 500); 7 Feb 2007 05:46:48 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 4463 invoked by uid 500); 7 Feb 2007 05:46:48 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 4452 invoked by uid 99); 7 Feb 2007 05:46:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2007 21:46:48 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of craigmcc@gmail.com designates 66.249.82.230 as permitted sender) Received: from [66.249.82.230] (HELO wx-out-0506.google.com) (66.249.82.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2007 21:46:38 -0800 Received: by wx-out-0506.google.com with SMTP id h31so108948wxd for ; Tue, 06 Feb 2007 21:46:17 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=ufUUKRzUQTDZp9z4nSDZT+gXFeIgoXXOhhw8C0ozuNyUkrsAzDNBO4CYJUMnEkn8BwiD6QwxJGcan/GHs+1phF+Owxl/ky88pp3w26zd1nsk36HlO204e4H1XG8vhSfRUcxeQX18AqYwS0K9XsRmERp6KtPIvbx8OLEKtcTML1M= Received: by 10.115.78.1 with SMTP id f1mr1150014wal.1170827177033; Tue, 06 Feb 2007 21:46:17 -0800 (PST) Received: by 10.114.234.10 with HTTP; Tue, 6 Feb 2007 21:46:16 -0800 (PST) Message-ID: Date: Tue, 6 Feb 2007 21:46:16 -0800 From: "Craig McClanahan" Sender: craigmcc@gmail.com To: "Jakarta Commons Users List" Subject: Re: [httpclient_common]_why httpclient's speed is the same with JDK httpurlconnection In-Reply-To: <84c568dd0702061706y30f2d5di8e9fc193727169ca@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8659_8915856.1170827176998" References: <84c568dd0702061706y30f2d5di8e9fc193727169ca@mail.gmail.com> X-Google-Sender-Auth: 296635c6d4b1362e X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_8659_8915856.1170827176998 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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(http://jakarta.apache.org).After< > http://jakarta.apache.org%29.After>testing, > 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 http://jakarta.apache.org? 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 requirements. Any help will be great appreciated Craig ------=_Part_8659_8915856.1170827176998--