I ran your script _unchanged_ on my machine and got this result:
https://gist.github.com/cstamas/b70f85ad601e5e2f399596b2e8cec7d1

Interestingly, http1 is quite "stable" -- roughly around 800ms
while http2 is quite "jumpy" -- goes from 600 to 920ms

Will try to add change to get the response content as well....

Thanks
T

On Thu, Nov 5, 2020 at 5:09 PM Tamás Cservenák <[email protected]> wrote:

> Hi Kuba,
>
> Can you clarify what exactly your script does re "download"?
> It seems it issues HTTP GET, but does it fully consume response?
> Does it get all the bytes of the artifact, or just the parses response
> header(s) and throws the rest?
>
> Thanks
> T
>
> On Thu, Nov 5, 2020 at 4:49 PM Jakub Bartecek <[email protected]> wrote:
>
>> Hi,
>> I did a performance test of HTTP/2 and its comparison with HTTP/1.1 and I
>> would like to share my results with you.
>>
>> I wrote a Python script [1] to download 100 artifacts in parallel using
>> asynchronous HTTP client supporting both HTTP/1.1 and HTTP/2. I chose 100
>> artifacts [2] from Maven Central, which were downloaded when I did a clean
>> build of one of my projects.
>>
>> All 100 artifacts were downloaded using HTTP/1.1 and also HTTP/2 and I
>> stored the results in this file [3]. I did 10 experiments and measured its
>> performance. In the middle I switch the order of HTTP/1.1 and HTTP/2
>> requests to avoid a possible bias. I run it from my laptop connected to
>> 160
>> Mbit/s network.
>>
>> The experiments showed massive performance improvements when using HTTP/2
>> instead of HTTP/1.1
>> *:*
>>
>>    - *The average download time using HTTP/1.1 was 3753.7 ms and using
>>    HTTP/2 971.8 ms* [4]
>>
>>
>>    - *In average the artifacts were downloaded 3.86 times faster using
>>    HTTP/2 than using HTTP/1.1* [5]
>>
>>
>> Kuba
>>
>> [1]:
>> https://github.com/jbartece/http2performance/blob/main/http2PerfTest.py
>> [2]:
>> https://github.com/jbartece/http2performance/blob/main/centralUrls.txt
>> [3]:
>> https://github.com/jbartece/http2performance/blob/main/testResults.txt
>> [4]:
>>
>> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L26
>> [5]:
>>
>> https://github.com/jbartece/http2performance/blob/main/finalResults.txt#L32
>>
>>
>> On Tue, Oct 27, 2020 at 8:42 AM Jakub Bartecek <[email protected]>
>> wrote:
>>
>> > I'll do some measurements and share the results with you. If it turns
>> out
>> > that it is worth the effort, how much work does it require? I'm
>> considering
>> > contributing it to Maven (or someone from my team).
>> >
>> > If it is contributed today, when can it be in an official Maven release?
>> >
>> > On Mon, Oct 26, 2020 at 7:09 PM Michael Osipov <[email protected]>
>> > wrote:
>> >
>> >> Am 2020-10-26 um 15:01 schrieb Jakub Bartecek:
>> >> > On Sun, Oct 25, 2020 at 10:25 AM Michael Osipov <[email protected]
>> >
>> >> wrote:
>> >> >
>> >> >> Am 2020-10-23 um 10:08 schrieb Jakub Bartecek:
>> >> >>> Hello,
>> >> >>> I'd like to ask if it is possible to turn on HTTP/2 support in
>> Maven.
>> >> I
>> >> >>> haven't found such an option.
>> >> >>>
>> >> >>> If not: Are there any plans to add the support?
>> >> >>
>> >> >> There is nothing to turn on and that would be unwise, something like
>> >> >> this should be done through ALPN.
>> >> >>
>> >> >> Maven uses by default Wagon HTTP Transport on top of Apache
>> >> >> HttpComponents 4.5.x. Beginning with Apache HttpComponent 5.0
>> HTTP/2 is
>> >> >> supported. One would need to write a new (updated) HTTP Transport to
>> >> >> move all gone.
>> >> >> There is one crucial issue needs to be solved first: HTTPCORE-626.
>> Also
>> >> >> read the related discussion [1].
>> >> >>
>> >> >> Is there anything explicitly you expect from HTTP/2 compared to
>> >> >> HTTP/1.1? I have done a lot of internal improvements to Wagon HTTP
>> this
>> >> >> year which covers a lot of use cases.
>> >> >>
>> >> >> Have you done testing with curl which proves some kind of
>> improvement?
>> >> >> I have talked about possible benefits of HTTP/2 in corporate
>> >> >> environments with jfclere@ and he sees little benefit because when
>> you
>> >> >> have a repo manager in house, you have (a) a gigabit connection and
>> (b)
>> >> >> minimal hops between client and repo manager.
>> >> >>
>> >> >
>> >> > Thanks for the clarification.
>> >> >
>> >> > I wanted to test out if there are significant performance
>> improvements
>> >> with
>> >> > HTTP/2 (which I hoped there could be),
>> >> > but I haven't done any measurements by simulating it with curl. My
>> first
>> >> > idea was to try it with Maven directly
>> >>
>> >> Please do that first to have any numbers to compare. I don't see to put
>> >> any effort into something which will deliver a single digit percent
>> >> improvement given the amount of work.
>> >>
>> >> Share numbers when you are ready.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [email protected]
>> >> For additional commands, e-mail: [email protected]
>> >>
>> >>
>>
>

Reply via email to