Skip to content

Commit

Permalink
Move 7z test to multi-threaded
Browse files Browse the repository at this point in the history
  • Loading branch information
NEMS Linux committed May 14, 2019
1 parent 112aeed commit d0bda6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 7 additions & 9 deletions benchmark.sh
Expand Up @@ -79,16 +79,14 @@ if [[ -z $prog ]]; then
fi

if [[ ! -z $prog ]]; then
# Get the total result from first CPU core
taskset -c 0 "$prog" b > $tmpdir/7z.log
result1=$(awk -F" " '/^Tot:/ {print $4}' <$tmpdir/7z.log | tr '\n' ', ' | sed 's/,$//')
# Get the total result from last CPU core (might be big.LITTLE, or could be same core)
taskset -c $(( $cores - 1 )) "$prog" b > $tmpdir/7z.log
result2=$(awk -F" " '/^Tot:/ {print $4}' <$tmpdir/7z.log | tr '\n' ', ' | sed 's/,$//')
average7z=$(( ($result1 + $result2) / 2 ))

# Multithreaded test
"$prog" b > $tmpdir/7z.log
result7z=$(awk -F" " '/^Tot:/ {print $4}' <$tmpdir/7z.log | tr '\n' ', ' | sed 's/,$//')
echo "Done." >> $tmpdir/nems-benchmark.log
echo "7z Benchmark Result: $average7z" >> $tmpdir/nems-benchmark.log
echo $average7z > /var/log/nems/benchmarks/7z
echo "7z Benchmark Result: $result7z" >> $tmpdir/nems-benchmark.log
echo $result7z > /var/log/nems/benchmarks/7z-multithread

else
echo "Can't find or install p7zip. 7z benchmark skipped." >> $tmpdir/nems-benchmark.log
fi
Expand Down
4 changes: 2 additions & 2 deletions info.sh
Expand Up @@ -372,8 +372,8 @@ elif [[ $COMMAND == "benchmark" ]]; then
fi
fi
if [[ $VARIABLE == '7z' ]]; then
if [[ -f /var/log/nems/benchmarks/7z ]]; then
cat /var/log/nems/benchmarks/7z
if [[ -f /var/log/nems/benchmarks/7z-multithread ]]; then
cat /var/log/nems/benchmarks/7z-multithread
else
echo 0
fi
Expand Down

0 comments on commit d0bda6e

Please sign in to comment.