Skip to content

Instantly share code, notes, and snippets.

@pankkor
Last active April 28, 2025 12:56
Show Gist options
  • Select an option

  • Save pankkor/b0970eb28547f5afa6776f8a8a143dfa to your computer and use it in GitHub Desktop.

Select an option

Save pankkor/b0970eb28547f5afa6776f8a8a143dfa to your computer and use it in GitHub Desktop.
Reduce performance variance of benchmarks

Reduce performance variance of benchmarks

Linux

  • Set/Reset the CPU governor
    cpupower frequency-info -o proc
    sudo cpupower frequency-set --governor performance
    
  • Disable CPU boosting
    echo 0 | sudo tee /sys/devices/system/cpu/cpufreq/boost
    
  • Pin task to a CPU
    # Pin task to CPU 0, 1, 2, 4
    taskset --cpu-list 0-2,4 ./command
    
  • Disable address splace layour randomization (ASLR):
    echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
    
    Reenable
    echo 2 | sudo tee /proc/sys/kernel/randomize_va_space
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment