4 # - `compiler` (27 MB) for compressed formats.
5 # - `rust` (229 MB) for uncompressed formats.
7 # Compressed formats benchmarked:
11 # Uncompressed formats benchmarked:
16 DESCOMPRESSION_CLEANUP
="rm output -r"
18 function call_hyperfine
() {
21 --export-markdown "${FUNCNAME[1]}.md"
24 function tar_compression
() {
25 cleanup
="rm output.tar"
28 'ouch compress rust output.tar' \
29 'tar -cvf output.tar rust' \
30 --prepare "$cleanup || true"
35 function tar_decompression
() {
36 echo "Creating tar archive to benchmark decompression..."
37 ouch
compress rust input.
tar --yes &> /dev
/null
40 'ouch decompress input.tar --dir output' \
41 'tar -xv -C output -f input.tar' \
42 --prepare "$DESCOMPRESSION_CLEANUP || true" \
43 --prepare "$DESCOMPRESSION_CLEANUP || true ; mkdir output"
45 $DESCOMPRESSION_CLEANUP
48 function tar_gz_compression
() {
49 cleanup
="rm output.tar.gz"
52 'ouch compress compiler output.tar.gz' \
53 'tar -cvzf output.tar.gz compiler' \
54 --prepare "$cleanup || true"
59 function tar_gz_decompression
() {
60 echo "Creating tar.gz archive to benchmark decompression..."
61 ouch
compress compiler input.
tar.gz
--yes &> /dev
/null
64 'ouch decompress input.tar.gz --dir output' \
65 'tar -xvz -C output -f input.tar.gz' \
66 --prepare "$DESCOMPRESSION_CLEANUP || true" \
67 --prepare "$DESCOMPRESSION_CLEANUP || true ; mkdir output"
69 $DESCOMPRESSION_CLEANUP
72 function zip_compression
() {
73 cleanup
="rm output.zip"
76 'zip output.zip -r compiler' \
77 'ouch compress compiler output.zip' \
78 --prepare "$cleanup || true"
83 function zip_decompression
() {
84 echo "Creating zip archive to benchmark decompression..."
85 ouch
compress compiler input.
zip --yes &> /dev
/null
88 'ouch decompress input.zip --dir output' \
89 'unzip input.zip -d output' \
90 --prepare "$DESCOMPRESSION_CLEANUP || true"
92 $DESCOMPRESSION_CLEANUP
95 function run_benches
() {
104 function concatenate_results
() {
105 cat tar_compression.md
<(echo) \
106 tar_decompression.md
<(echo) \
107 tar_gz_compression.md
<(echo) \
108 tar_gz_decompression.md
<(echo) \
109 zip_compression.md
<(echo) \
110 zip_decompression.md
> results.md
117 echo "check results at results.md"