All right. I have found the culprit. It is our much loved & loathed
(depending upon the circumstances) HttpConnection#isStale(). By making
this method always return false the average response time goes down from
23ms to 6ms using the test app posted below.
Thoughts? suggestions?
Oleg
On Sun, 2003-07-27 at 14:24, Oleg Kalnichevski wrote:
> Folks,
> Sadly enough, I have to confirm the performance problem reported by Todd
> Wolff <[EMAIL PROTECTED]>. HttpClient's performance as of 2.0 beta-1
> degraded almost four-fold compared to 2.0 alpha-3. The problem is fairly
> easy to reproduce:
>
> import org.apache.commons.httpclient.*;
> import org.apache.commons.httpclient.methods.*;
>
> public class Test {
>
> public static void main(String args[]) throws Exception {
>
> HttpClient httpclient = new HttpClient();
> long s = 0;
> for (int i = 0; i < 200; i ++) {
> GetMethod httpget = new GetMethod(
> "http://localhost:8080/httpclienttest/body");
> long start = System.currentTimeMillis();
> httpclient.executeMethod(httpget);
> long end = System.currentTimeMillis();
> long duration = end - start;
> System.out.println("Execution time in ms: " + duration);
> s += duration;
> }
> System.out.println("Average: " + (s / 200));
> }
>
> On my system I get average response time of 5ms with 2.0a3 compared to
> 23ms with 2.0rc1. I have no idea what kind of lunacy we have pulled off
> to make that happen. I checked the most obvious suspects:
> HttpConnection, wire logs. No solution yet.
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]