#!/bin/bash # Settings ISO_FILE="Fedora-Workstation-43.iso" LEVEL="-6" THREADS=(1 4 8) # Check for file if [ ! -f "$ISO_FILE" ]; then echo "Error: $ISO_FILE not found." exit 1 fi echo "--- Benchmarking xz Scaling on RISC-V ---" echo "Target: $ISO_FILE (Level $LEVEL)" echo "--------------------------------------------------------" echo "Threads | Real Time | User Time | CPU % | RAM (est)" echo "--------------------------------------------------------" for T in "${THREADS[@]}"; do # Calculate estimated RAM usage for Level 6 RAM_EST=$((T * 94)) # We use /usr/bin/time to capture: # %e (wall time), %U (user time), %P (CPU percentage) /usr/bin/time -f " $T | %es | %Us | %P | ~${RAM_EST}MB" \ xz $LEVEL -T$T -c "$ISO_FILE" > /dev/null done echo "--------------------------------------------------------" echo "Done. No files were written to disk."