diff --git a/llvm/docs/Benchmarking.rst b/llvm/docs/Benchmarking.rst index cd7b835e47c53..d168965114459 100644 --- a/llvm/docs/Benchmarking.rst +++ b/llvm/docs/Benchmarking.rst @@ -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=g none dir_to_mount @@ -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:: @@ -73,7 +73,7 @@ Linux cset shield --exec -- perf stat -r 10 - 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 ```` 10 times and reports statistics. @@ -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