From fe65457e80ef8ab6bbd6da418ab7cb6f6102afda Mon Sep 17 00:00:00 2001 From: SunBlack Date: Tue, 10 Jan 2023 13:25:32 +0100 Subject: [PATCH] Fix typos found by codespell (#1519) --- CMakeLists.txt | 2 +- bindings/python/google_benchmark/__init__.py | 2 +- bindings/python/google_benchmark/example.py | 2 +- docs/perf_counters.md | 2 +- docs/reducing_variance.md | 2 +- include/benchmark/benchmark.h | 2 +- src/benchmark.cc | 4 ++-- src/complexity.h | 2 +- src/console_reporter.cc | 2 +- src/perf_counters.cc | 2 +- src/statistics.h | 7 ++++--- src/sysinfo.cc | 2 +- test/benchmark_setup_teardown_test.cc | 2 +- tools/gbench/util.py | 2 +- 14 files changed, 18 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b9dd38e..f7a17d8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,7 +236,7 @@ else() # On most UNIX like platforms g++ and clang++ define _GNU_SOURCE as a # predefined macro, which turns on all of the wonderful libc extensions. - # However g++ doesn't do this in Cygwin so we have to define it ourselfs + # However g++ doesn't do this in Cygwin so we have to define it ourselves # since we depend on GNU/POSIX/BSD extensions. if (CYGWIN) add_definitions(-D_GNU_SOURCE=1) diff --git a/bindings/python/google_benchmark/__init__.py b/bindings/python/google_benchmark/__init__.py index 10f5d5dd..e6ef8e7d 100644 --- a/bindings/python/google_benchmark/__init__.py +++ b/bindings/python/google_benchmark/__init__.py @@ -104,7 +104,7 @@ class __OptionMaker: options = self.make(func_or_options) options.builder_calls.append((builder_name, args, kwargs)) # The decorator returns Options so it is not technically a decorator - # and needs a final call to @regiser + # and needs a final call to @register return options return __decorator diff --git a/bindings/python/google_benchmark/example.py b/bindings/python/google_benchmark/example.py index 487acc9f..d95a0438 100644 --- a/bindings/python/google_benchmark/example.py +++ b/bindings/python/google_benchmark/example.py @@ -72,7 +72,7 @@ def manual_timing(state): @benchmark.register def custom_counters(state): - """Collect cutom metric using benchmark.Counter.""" + """Collect custom metric using benchmark.Counter.""" num_foo = 0.0 while state: # Benchmark some code here diff --git a/docs/perf_counters.md b/docs/perf_counters.md index db83145c..f342092c 100644 --- a/docs/perf_counters.md +++ b/docs/perf_counters.md @@ -19,7 +19,7 @@ The feature does not require modifying benchmark code. Counter collection is handled at the boundaries where timer collection is also handled. To opt-in: -* If using a Bazel build, add `--define pfm=1` to your buid flags +* If using a Bazel build, add `--define pfm=1` to your build flags * If using CMake: * Install `libpfm4-dev`, e.g. `apt-get install libpfm4-dev`. * Enable the CMake flag `BENCHMARK_ENABLE_LIBPFM` in `CMakeLists.txt`. diff --git a/docs/reducing_variance.md b/docs/reducing_variance.md index f8b75758..e566ab98 100644 --- a/docs/reducing_variance.md +++ b/docs/reducing_variance.md @@ -70,7 +70,7 @@ reason some companies maintain machines dedicated to performance testing. Some of the easier and and effective ways of reducing variance on a typical Linux workstation are: -1. Use the performance governer as [discussed +1. Use the performance governor as [discussed above](user_guide#disabling-cpu-frequency-scaling). 1. Disable processor boosting by: ```sh diff --git a/include/benchmark/benchmark.h b/include/benchmark/benchmark.h index d8032ec0..eb29ca50 100644 --- a/include/benchmark/benchmark.h +++ b/include/benchmark/benchmark.h @@ -1845,7 +1845,7 @@ inline double GetTimeUnitMultiplier(TimeUnit unit) { // Creates a list of integer values for the given range and multiplier. // This can be used together with ArgsProduct() to allow multiple ranges -// with different multiplers. +// with different multipliers. // Example: // ArgsProduct({ // CreateRange(0, 1024, /*multi=*/32), diff --git a/src/benchmark.cc b/src/benchmark.cc index 12b2d16d..ec729f7a 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -73,8 +73,8 @@ BM_DEFINE_string(benchmark_filter, ""); BM_DEFINE_double(benchmark_min_time, 0.5); // Minimum number of seconds a benchmark should be run before results should be -// taken into account. This e.g can be neccessary for benchmarks of code which -// needs to fill some form of cache before performance is of interrest. +// taken into account. This e.g can be necessary for benchmarks of code which +// needs to fill some form of cache before performance is of interest. // Note: results gathered within this period are discarded and not used for // reported result. BM_DEFINE_double(benchmark_min_warmup_time, 0.0); diff --git a/src/complexity.h b/src/complexity.h index df29b48d..0a0679b4 100644 --- a/src/complexity.h +++ b/src/complexity.h @@ -31,7 +31,7 @@ std::vector ComputeBigO( const std::vector& reports); // This data structure will contain the result returned by MinimalLeastSq -// - coef : Estimated coeficient for the high-order term as +// - coef : Estimated coefficient for the high-order term as // interpolated from data. // - rms : Normalized Root Mean Squared Error. // - complexity : Scalability form (e.g. oN, oNLogN). In case a scalability diff --git a/src/console_reporter.cc b/src/console_reporter.cc index 3950e498..f3d81b25 100644 --- a/src/console_reporter.cc +++ b/src/console_reporter.cc @@ -115,7 +115,7 @@ static std::string FormatTime(double time) { if (time < 100.0) { return FormatString("%10.1f", time); } - // Assuming the time ist at max 9.9999e+99 and we have 10 digits for the + // Assuming the time is at max 9.9999e+99 and we have 10 digits for the // number, we get 10-1(.)-1(e)-1(sign)-2(exponent) = 5 digits to print. if (time > 9999999999 /*max 10 digit number*/) { return FormatString("%1.4e", time); diff --git a/src/perf_counters.cc b/src/perf_counters.cc index 582475f0..06351b69 100644 --- a/src/perf_counters.cc +++ b/src/perf_counters.cc @@ -68,7 +68,7 @@ PerfCounters PerfCounters::Create( return NoCounters(); } attr.disabled = is_first; - // Note: the man page for perf_event_create suggests inerit = true and + // Note: the man page for perf_event_create suggests inherit = true and // read_format = PERF_FORMAT_GROUP don't work together, but that's not the // case. attr.inherit = true; diff --git a/src/statistics.h b/src/statistics.h index b0d2c05e..6e5560e8 100644 --- a/src/statistics.h +++ b/src/statistics.h @@ -22,9 +22,10 @@ namespace benchmark { -// Return a vector containing the mean, median and standard devation information -// (and any user-specified info) for the specified list of reports. If 'reports' -// contains less than two non-errored runs an empty vector is returned +// Return a vector containing the mean, median and standard deviation +// information (and any user-specified info) for the specified list of reports. +// If 'reports' contains less than two non-errored runs an empty vector is +// returned BENCHMARK_EXPORT std::vector ComputeStats( const std::vector& reports); diff --git a/src/sysinfo.cc b/src/sysinfo.cc index 41c0f9f9..59120b72 100644 --- a/src/sysinfo.cc +++ b/src/sysinfo.cc @@ -441,7 +441,7 @@ std::string GetSystemName() { return str; #else #ifndef HOST_NAME_MAX -#ifdef BENCHMARK_HAS_SYSCTL // BSD/Mac Doesnt have HOST_NAME_MAX defined +#ifdef BENCHMARK_HAS_SYSCTL // BSD/Mac doesn't have HOST_NAME_MAX defined #define HOST_NAME_MAX 64 #elif defined(BENCHMARK_OS_NACL) #define HOST_NAME_MAX 64 diff --git a/test/benchmark_setup_teardown_test.cc b/test/benchmark_setup_teardown_test.cc index a2cb82a9..6c3cc2e5 100644 --- a/test/benchmark_setup_teardown_test.cc +++ b/test/benchmark_setup_teardown_test.cc @@ -145,7 +145,7 @@ int main(int argc, char** argv) { // Setup is called 4 times, once for each arg group (1,3,5,7) assert(fixture_interaction::setup == 4); - // Fixture::Setup is called everytime the bm routine is run. + // Fixture::Setup is called every time the bm routine is run. // The exact number is indeterministic, so we just assert that // it's more than setup. assert(fixture_interaction::fixture_setup > fixture_interaction::setup); diff --git a/tools/gbench/util.py b/tools/gbench/util.py index 5d0012c0..95d7994b 100644 --- a/tools/gbench/util.py +++ b/tools/gbench/util.py @@ -58,7 +58,7 @@ def classify_input_file(filename): """ Return a tuple (type, msg) where 'type' specifies the classified type of 'filename'. If 'type' is 'IT_Invalid' then 'msg' is a human readable - string represeting the error. + string representing the error. """ ftype = IT_Invalid err_msg = None