From: Andre Ramnitz Date: Thu, 5 Sep 2024 21:41:44 +0000 (+0200) Subject: scripts: improve best_makeopts.sh a bit X-Git-Tag: v0.2~97 X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=43e7f257a5ddcd5e7b94b4475594da8d274598be;p=dotfiles.git scripts: improve best_makeopts.sh a bit --- 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"