diff options
Diffstat (limited to 'benchmarker')
-rwxr-xr-x | benchmarker | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/benchmarker b/benchmarker index 1f8da4d..b83e5b9 100755 --- a/benchmarker +++ b/benchmarker @@ -21,11 +21,33 @@ gotfile() cpubench_xz() { local filename - echo "CPU benchmark (xz on a large sparse file)" + local size + + size=1G filename="$(mktemp)" truncate -s 10G "$filename" + + echo "CPU benchmark (xz on a $size sparse file)" /bin/time --format="%e" xz -T0 < "$filename" > /dev/null rm -f "$filename" } +netbench() +{ + local filename + local port + local size + + filename="$(mktemp)" + port=3858 + size=10G + truncate -s "$size" "$filename" + + echo "Network benchmark (netcat a $size sparse file across localhost)" + nc -l localhost "$port" > /dev/null & + /bin/time --format="%e" nc -N localhost "$port" < "$filename" + rm -f "$filename" +} + cpubench_xz +netbench |