diff options
| author | Andreas Kapp Lindquist <andkaplin05@gmail.com> | 2025-10-23 17:56:12 +0200 |
|---|---|---|
| committer | mithe24 <mithe24@student.sdu.dk> | 2025-10-29 13:49:57 +0100 |
| commit | 2bb91575a5a5d033e97c2bb329f18c83eaaaa991 (patch) | |
| tree | fd47cef799a338deb244e6a394313e9245d88985 /test/benchmark.sh | |
| parent | bb687ca28d9da1e161b8e382771fe919fa698b01 (diff) | |
| download | sorter-2bb91575a5a5d033e97c2bb329f18c83eaaaa991.tar.gz sorter-2bb91575a5a5d033e97c2bb329f18c83eaaaa991.zip | |
test(benchmark.sh): moved to test and added support for different types
Diffstat (limited to '')
| -rwxr-xr-x | test/benchmark.sh (renamed from benchmark.sh) | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/benchmark.sh b/test/benchmark.sh index 3811fc2..2f0d90b 100755 --- a/benchmark.sh +++ b/test/benchmark.sh @@ -1,10 +1,10 @@ #!/bin/sh DATA_DIR="data" -SRC_DIR="src" +SRC_DIR="../src" SORTER="$SRC_DIR/sorter" -OUTPUT_STRING="size,real,user,sys" +OUTPUT_STRING="type,size,real,user,sys" for TEST_FILE in "$DATA_DIR"/*; do FILE_NAME=$(basename "$TEST_FILE") @@ -19,12 +19,14 @@ for TEST_FILE in "$DATA_DIR"/*; do SYS=$(echo "$TIME_OUTPUT" | awk '/sys/ {split($2,a,"m"); split(a[2],b,"s"); print a[1]*60 + b[1]}') # Remove prefix and suffix - TEST_SIZE=${FILE_NAME#random_} # removes 'random_' - TEST_SIZE=${TEST_SIZE%_run*} # removes '_run...' part + # type_size_n.tsv + TYPE="${FILE_NAME%%_*}" # before first _ + rest="${FILE_NAME#*_}" # after first _ + TEST_SIZE="${rest%%_*}" # before next _ # Add entry to JSON string OUTPUT_STRING="$OUTPUT_STRING -$TEST_SIZE,$REAL,$USER,$SYS" +$TYPE,$TEST_SIZE,$REAL,$USER,$SYS" done # Write to file |