Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions llvm/docs/Benchmarking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ for example.
General
================================

* Use a high resolution timer, e.g. perf under linux.
* Use a high-resolution timer, e.g., perf under Linux.

* Run the benchmark multiple times to be able to recognize noise.

* Disable as many processes or services as possible on the target system.

* Disable frequency scaling, turbo boost and address space
randomization (see OS specific section).
* Disable frequency scaling, Turbo Boost and address space
randomization (see OS-specific section).

* Static link if the OS supports it. That avoids any variation that
* Use static linking if the OS supports it. That avoids any variation that
might be introduced by loading dynamic libraries. This can be done
by passing ``-DLLVM_BUILD_STATIC=ON`` to cmake.
by passing ``-DLLVM_BUILD_STATIC=ON`` to CMake.

* Try to avoid storage. On some systems you can use tmpfs. Putting the
* Try to avoid storage. On some systems, you can use tmpfs. Putting the
program, inputs and outputs on tmpfs avoids touching a real storage
system, which can have a pretty big variability.

To mount it (on linux and freebsd at least)::
To mount it (on Linux and FreeBSD at least)::

mount -t tmpfs -o size=<XX>g none dir_to_mount

Expand All @@ -52,7 +52,7 @@ Linux
echo performance > $i
done

* Use https://github.com/lpechacek/cpuset to reserve cpus for just the
* Use https://github.com/lpechacek/cpuset to reserve CPU cores for just the
program you are benchmarking. If using perf, leave at least 2 cores
so that perf runs in one and your program in another::

Expand All @@ -73,7 +73,7 @@ Linux

cset shield --exec -- perf stat -r 10 <cmd>

This will run the command after ``--`` in the isolated cpus. The
This will run the command after ``--`` in the isolated CPU cores. The
particular perf command runs the ``<cmd>`` 10 times and reports
statistics.

Expand All @@ -82,6 +82,6 @@ With these in place you can expect perf variations of less than 0.1%.
Linux Intel
-----------

* Disable turbo mode::
* Disable Turbo Boost::

echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
Loading