Oleg,

The late hour puzzled me about the number of nanoseconds in one second
:). So what I had was 3 millis instead of 3 seconds.

Applying this latest math together with a thread-safe 'Via' cache
implementation that has read/write locks shows a decrease of time in
the generateViaHeader method on a much powerfull laptop from about
10,000 microseconds to 30-40 micro-seconds. I can see this method
being called both when sending the request and receiving the response
from backend, but I'm not sure if this difference worths the effort.

Alin


On 12 October 2011 14:53, Oleg Kalnichevski <[email protected]> wrote:
> On Tue, 2011-10-11 at 23:21 +0300, Vasile Alin wrote:
>> Since we handle a small number of protocols (such as HTTP and HTTPS
>> 1.0 and 1.1), we could cache generated Via headers in
>> CachingHttpClient. Each header takes around 3 seconds to create on my
>> machine - Win7 64 bit, AMD Turion X2 & 4Gb of RAM - (would be
>> interesting to find values for other platforms) and would worth
>> improving this area by caching generated Via headers by putting them
>> in a Map with a ProtocolVersion key.
>>
>> Tests show that having this cache in place reduces the time to
>> generate a Via header for each request from 3 seconds to 8 millis.
>> What do you think?
>>
>> Alin
>>
>
> Hi Alin
>
> Jon is the authority on the subject of HTTP caching, so his opinion will
> matter most. As far as I am concerned anything that can reduce execution
> time from 3000 to 8 ms is worth pursuing. As always the best way to get
> things done here at ASF is by raising a JIRA and submitting a patch.
>
> Cheers
>
> 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]

Reply via email to