added instructions for benchmarking
This commit is contained in:
parent
9b17d7b2d6
commit
f8b83015fa
|
@ -1,6 +1,23 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
# Run it with
|
# Commands and ideas from: https://llvm.org/docs/Benchmarking.html
|
||||||
# export CPU=0; /usr/bin/taskset --cpu-list $CPU ./bench.py $CPU
|
# we assume that CPU 0 and 1 are together in an intel SMT-pair (hyperthreading)
|
||||||
|
# - Disable address space randomization:
|
||||||
|
# echo 0 > /proc/sys/kernel/randomize_va_space
|
||||||
|
# - Set scaling governor to performance for CPU 0
|
||||||
|
# echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
|
||||||
|
# - Reserve CPU 0 fro our benchmark
|
||||||
|
# cset shield --cpu 0 --kthread=on
|
||||||
|
# - Disable the SMT-peer of CPU 0, i.e. CPU 1
|
||||||
|
# echo 0 > /sys/devices/system/cpu/cpu1/online
|
||||||
|
# - Disable turbo mode (works only on Intel):
|
||||||
|
# echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
|
||||||
|
# - Run with
|
||||||
|
# cset shield --exec -- ./bench.py
|
||||||
|
#
|
||||||
|
|
||||||
|
# To use the full power of the CPU, skip all the other steps and
|
||||||
|
# just run with
|
||||||
|
# taskset --cpu-list 0 ./bench.py
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import timeit
|
import timeit
|
||||||
|
|
Loading…
Reference in a new issue