mirror of
https://gitlab.com/gnuwget/wget2.git
synced 2026-02-01 04:10:48 +00:00
* benchmarks/README: New file, short description * benchmarks/bench_https_http1: New file, HTTPS via HTTP/1.1 * benchmarks/bench_https_http2: New file, HTTPS via HTTP/2.0
82 lines
1.9 KiB
Bash
Executable File
82 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
title="HTTPS via HTTP/2.0"
|
|
wget_options="-q -O/dev/null"
|
|
wget_version=$(wget --version|head -1|cut -d' ' -f3)
|
|
wget2_options="-q -O/dev/null"
|
|
wget2_version=$(../src/wget2_noinstall --version 2>/dev/null|head -1|cut -d' ' -f2)
|
|
curl_options="-s --cert-status --http2 -o/dev/null"
|
|
curl_version=$(curl --version|head -1|cut -d' ' -f2)
|
|
|
|
NCHECKS=3
|
|
MINX=1
|
|
MAXX=3
|
|
SLEEP=0.5
|
|
|
|
rm -f wget.data wget2.data curl.data
|
|
|
|
for ((nreq=$MINX;nreq<=$MAXX;nreq++)); do
|
|
urls=""
|
|
for ((i=1;i<=nreq;i++)); do
|
|
urls="$urls https://www.google.com/a${i}.html"
|
|
done
|
|
|
|
# timings for wget
|
|
for ((i=0;i<$NCHECKS;i++)); do
|
|
t1=$(date +%s%3N)
|
|
wget ${wget_options} $urls
|
|
t2=$(date +%s%3N)
|
|
echo $nreq $((t2-t1))
|
|
sleep $SLEEP
|
|
done >>wget.data
|
|
|
|
# timings for wget2
|
|
for ((i=0;i<$NCHECKS;i++)); do
|
|
t1=$(date +%s%3N)
|
|
../src/wget2_noinstall ${wget2_options} $urls
|
|
t2=$(date +%s%3N)
|
|
echo $nreq $((t2-t1))
|
|
sleep $SLEEP
|
|
done >>wget2.data
|
|
|
|
# timings for curl
|
|
for ((i=0;i<$NCHECKS;i++)); do
|
|
t1=$(date +%s%3N)
|
|
curl ${curl_options} $urls >/dev/null 2>&1
|
|
t2=$(date +%s%3N)
|
|
echo $nreq $((t2-t1))
|
|
sleep $SLEEP
|
|
done >>curl.data
|
|
done
|
|
|
|
|
|
cat <<EOF | gnuplot
|
|
set terminal svg
|
|
set output "$0.svg"
|
|
|
|
set title "${title}\n\
|
|
Debian Sid amd64, Intel i3-2100 at 3.10GHz\n\
|
|
50MBit/s DSL, RTT 35ms to www.google.com\n\
|
|
wget ${wget_version} options: ${wget_options}\n\
|
|
wget2 ${wget2_version} options: ${wget2_options}\n\
|
|
curl ${curl_version} options: ${curl_options}"
|
|
|
|
# aspect ratio for image size
|
|
#set size 1,0.7
|
|
|
|
# y-axis grid
|
|
set grid y
|
|
|
|
# x-axis label
|
|
set xlabel "number of URLs"
|
|
|
|
#y-axis label
|
|
set ylabel "wall time (ms)"
|
|
|
|
plot \
|
|
"wget2.data" using 1:2 smooth sbezier with lines title "wget2", \
|
|
"wget.data" using 1:2 smooth sbezier with lines title "wget", \
|
|
"curl.data" using 1:2 smooth sbezier with lines title "curl"
|
|
|
|
EOF
|