From 43e7f257a5ddcd5e7b94b4475594da8d274598be Mon Sep 17 00:00:00 2001 From: Andre Ramnitz Date: Thu, 5 Sep 2024 23:41:44 +0200 Subject: [PATCH] scripts: improve best_makeopts.sh a bit --- local/dot-local/bin/best_makeopts.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/local/dot-local/bin/best_makeopts.sh b/local/dot-local/bin/best_makeopts.sh index 865e283f..bb0f2143 100755 --- a/local/dot-local/bin/best_makeopts.sh +++ b/local/dot-local/bin/best_makeopts.sh @@ -1,17 +1,23 @@ #!/bin/bash -cpupower frequency-set -g performance -r +if [[ $(id -u) -ne 0 ]]; +then + echo "Please run this script with sudo/as root." + exit +fi -PACKAGE="kde-frameworks/plasma" +cpupower frequency-set -g performance -r > /dev/null 2>&1 && echo "CPU Governor: performance" + +PACKAGE="kde-apps/gwenview" DISTDIR="/tmp/" emerge -f ${PACKAGE} -for i in {1..32} +for i in {8,16,20,24,28,32} do echo 1 > /proc/sys/vm/drop_caches + echo "Running with ${i} cores:" time DISTDIR="/tmp" EMERGE_DEFAULT_OPTS="" MAKEOPTS="-j${i}" emerge -q1OB ${PACKAGE} - echo -ne "\n\n\n" done -cpupower frequency-set -g schedutil -r +cpupower frequency-set -g schedutil -r > /dev/null 2>&1 && echo "CPU Governor: schedutil" -- 2.51.2