#!/bin/bash # Files to test FILES=("tsz-compressed-data.bin" "fuzz/index.html" "average-compression-tsz-data.png") # Compression tools and their commands tools=("gzip" "bzip2" "xz" "zstd" "hsz") get_tool_command() { local tool=$1 case $tool in "gzip") echo "gzip -c" ;; "bzip2") echo "bzip2 -c" ;; "xz") echo "xz -c" ;; "zstd") echo "zstd -c" ;; "hsz") echo "hsz" ;; *) echo "" ;; esac } # Function to measure time and output size measure() { local tool=$1 local command=$(get_tool_command $tool) local infile=$2 local outfile="$infile.$tool" local decompressfile="$outfile.dec" # Initialize sums for averaging local sum_compression_time=0 local sum_decompression_time=0 local sum_compression_ratio=0 # Number of runs for averaging local runs=5 for ((i=0; i '$outfile'" 2> compress_time.txt compress_time=$( '$decompressfile'" 2> decompress_time.txt decompress_time=$( '$outfile'" 2> compress_time.txt compress_time=$( '$decompressfile'" 2> decompress_time.txt decompress_time=$(