From 1ccd8354c1f2c3ae43df31e0319b75d951eba764 Mon Sep 17 00:00:00 2001 From: konsti Date: Mon, 12 Feb 2024 22:36:11 -0500 Subject: [PATCH] Don't forget to set your cpu to performance mode (#9700) Since i just spent quite some time wondering why my benchmarks were the opposite of what they should be, a reminder to check your cpu governor. Setting mine to perf mode was crucial. --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 57569228e3..305e832327 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -387,6 +387,11 @@ We have several ways of benchmarking and profiling Ruff: - Microbenchmarks which run the linter or the formatter on individual files. These run on pull requests. - Profiling the linter on either the microbenchmarks or entire projects +> \[!NOTE\] +> When running benchmarks, ensure that your CPU is otherwise idle (e.g., close any background +> applications, like web browsers). You may also want to switch your CPU to a "performance" +> mode, if it exists, especially when benchmarking short-lived processes. + ### CPython Benchmark First, clone [CPython](https://github.com/python/cpython). It's a large and diverse Python codebase,