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.

Revisions

  1. pankkor revised this gist Apr 28, 2025. No changes.
  2. pankkor revised this gist Apr 28, 2025. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions perf_variance.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    Reduce performance variance of benchmarks

    # Linux
    - Set/Reset the CPU governor
    ```
  3. pankkor revised this gist Apr 28, 2025. No changes.
  4. pankkor created this gist Apr 28, 2025.
    23 changes: 23 additions & 0 deletions perf_variance.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    # 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
    ```