From 1318865305834c402f61c0b9d5ad06b6900f1de7 Mon Sep 17 00:00:00 2001 From: dominic <510002+dmah42@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:01:16 +0100 Subject: [PATCH] try disabling liquid for jekyll to fix curly braces (#1536) * try disabling liquid for jekyll to fix curly braces * do it properly with commented out tags --- docs/AssemblyTests.md | 2 ++ docs/_config.yml | 2 +- docs/user_guide.md | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/AssemblyTests.md b/docs/AssemblyTests.md index 1fbdc269..89df7ca5 100644 --- a/docs/AssemblyTests.md +++ b/docs/AssemblyTests.md @@ -111,6 +111,7 @@ between compilers or compiler versions. A common example of this is matching stack frame addresses. In this case regular expressions can be used to match the differing bits of output. For example: + ```c++ int ExternInt; struct Point { int x, y, z; }; @@ -127,6 +128,7 @@ extern "C" void test_store_point() { // CHECK: ret } ``` + ## Current Requirements and Limitations diff --git a/docs/_config.yml b/docs/_config.yml index 2f7efbea..fff4ab92 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-minimal \ No newline at end of file +theme: jekyll-theme-minimal diff --git a/docs/user_guide.md b/docs/user_guide.md index 3c2e8f7e..fbd29b9a 100644 --- a/docs/user_guide.md +++ b/docs/user_guide.md @@ -386,14 +386,17 @@ short-hand. The following macro will pick a few appropriate arguments in the product of the two specified ranges and will generate a benchmark for each such pair. + ```c++ BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {128, 512}}); ``` + Some benchmarks may require specific argument values that cannot be expressed with `Ranges`. In this case, `ArgsProduct` offers the ability to generate a benchmark input for each combination in the product of the supplied vectors. + ```c++ BENCHMARK(BM_SetInsert) ->ArgsProduct({{1<<10, 3<<10, 8<<10}, {20, 40, 60, 80}}) @@ -412,6 +415,7 @@ BENCHMARK(BM_SetInsert) ->Args({3<<10, 80}) ->Args({8<<10, 80}); ``` + For the most common scenarios, helper methods for creating a list of integers for a given sparse or dense range are provided. @@ -697,6 +701,7 @@ is 1k a 1000 (default, `benchmark::Counter::OneK::kIs1000`), or 1024 When you're compiling in C++11 mode or later you can use `insert()` with `std::initializer_list`: + ```c++ // With C++11, this can be done: state.counters.insert({{"Foo", numFoos}, {"Bar", numBars}, {"Baz", numBazs}}); @@ -705,6 +710,7 @@ When you're compiling in C++11 mode or later you can use `insert()` with state.counters["Bar"] = numBars; state.counters["Baz"] = numBazs; ``` + ### Counter Reporting @@ -873,6 +879,7 @@ is measured. But sometimes, it is necessary to do some work inside of that loop, every iteration, but without counting that time to the benchmark time. That is possible, although it is not recommended, since it has high overhead. + ```c++ static void BM_SetInsert_With_Timer_Control(benchmark::State& state) { std::set data; @@ -887,6 +894,7 @@ static void BM_SetInsert_With_Timer_Control(benchmark::State& state) { } BENCHMARK(BM_SetInsert_With_Timer_Control)->Ranges({{1<<10, 8<<10}, {128, 512}}); ``` +