From c35a2ffe87fb8c60d1dac28a4f7c5147d499c723 Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Mon, 5 Dec 2022 15:04:49 +0100 Subject: [PATCH 1/8] Added link to Meeting C++ video with benchmarks on Poacher --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 5c60675..f0190ac 100644 --- a/readme.md +++ b/readme.md @@ -164,3 +164,5 @@ per benchmark case. In this case, you would then get 3 graphs https://cppp.fr/schedule2021/) - [Pyperf - Tune the system for benchmarks]( https://pyperf.readthedocs.io/en/latest/system.html) +- [A totally constexpr standard library - Paul Keir, Joel Falcou et al - Meeting C++ 2022]( + https://www.youtube.com/watch?v=ekFPm7e__vI) From 257b98e2435c62734a2d1455b5052f21e9b55783 Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Mon, 5 Dec 2022 15:40:37 +0100 Subject: [PATCH 2/8] Documentation title changed to CMake API reference --- cmake/ctbench-api.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/ctbench-api.cmake b/cmake/ctbench-api.cmake index 37fb663..bbfb31d 100644 --- a/cmake/ctbench-api.cmake +++ b/cmake/ctbench-api.cmake @@ -1,4 +1,4 @@ -#! # CMake documentation +#! # CMake API reference ## ============================================================================= #@ From 83e5eb8edf294a52d2057c06da4ff258686951f3 Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Mon, 5 Dec 2022 15:42:17 +0100 Subject: [PATCH 3/8] Added message in case branch is not main --- hooks/pre-push | 1 + 1 file changed, 1 insertion(+) diff --git a/hooks/pre-push b/hooks/pre-push index c07f8e5..a0ecd7d 100755 --- a/hooks/pre-push +++ b/hooks/pre-push @@ -13,6 +13,7 @@ srcdir=$(pwd) branch=$(git rev-parse --abbrev-ref HEAD) if [[ $branch -ne "main" ]]; then + echo "Branch is not main, exiting." exit 0 fi From 65df6795142300e2b1e3cc70deadb340eafa40fb Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Mon, 5 Dec 2022 15:43:57 +0100 Subject: [PATCH 4/8] Trying to fix wrong condition on current branch --- hooks/pre-push | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hooks/pre-push b/hooks/pre-push index a0ecd7d..8843117 100755 --- a/hooks/pre-push +++ b/hooks/pre-push @@ -12,7 +12,9 @@ srcdir=$(pwd) branch=$(git rev-parse --abbrev-ref HEAD) -if [[ $branch -ne "main" ]]; then +echo Current branch: $branch + +if [[ "$branch" -ne "main" ]]; then echo "Branch is not main, exiting." exit 0 fi From 49e30c4b271c51992f6c4e5bcde92c4ed5f03262 Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Mon, 5 Dec 2022 15:46:12 +0100 Subject: [PATCH 5/8] Fixed wrong condition on current branch for doc building --- hooks/pre-push | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/pre-push b/hooks/pre-push index 8843117..73b4d56 100755 --- a/hooks/pre-push +++ b/hooks/pre-push @@ -14,7 +14,7 @@ branch=$(git rev-parse --abbrev-ref HEAD) echo Current branch: $branch -if [[ "$branch" -ne "main" ]]; then +if [[ "$branch" != "main" ]]; then echo "Branch is not main, exiting." exit 0 fi From 89e1195ceeb66be8d244113bea96caa4ff0d612e Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Mon, 5 Dec 2022 15:49:08 +0100 Subject: [PATCH 6/8] Fixed formatting for doxygen docs --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index f0190ac..67e7f90 100644 --- a/readme.md +++ b/readme.md @@ -26,7 +26,7 @@ reference project for using ctbench. ## Using ctbench -### Installing `ctbench` +### Installing ctbench ```sh git clone https://github.com/jpenuchot/ctbench @@ -36,7 +36,7 @@ cmake --build --preset release sudo cmake --build --preset release --target install ``` -### Integrating `ctbench` in your project +### Integrating ctbench in your project Use `find_package(ctbench REQUIRED)` after installing it. From 0686ef4059f5d9ac93af35a7e919a5ea33d79f7a Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Wed, 7 Dec 2022 17:01:20 +0100 Subject: [PATCH 7/8] Improved docs: added graphs, added link to CMake API reference in the readme file, fixed typo in docs.cmake --- cmake/docs.cmake | 5 +++-- readme.md | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/cmake/docs.cmake b/cmake/docs.cmake index 56cf4fe..5d149ab 100644 --- a/cmake/docs.cmake +++ b/cmake/docs.cmake @@ -1,10 +1,11 @@ # Documentation options set(DOXYGEN_EXTRACT_ALL YES) set(DOXYGEN_GENERATE_TREEVIEW YES) -set(DOXYGEN_EXCLUDE_PATTERNS */build/* */tests/* */build-docs/*) +set(DOXYGEN_EXCLUDE_PATTERNS */build/* */tests/* */build-docs/* paper.md) set(DOXYGEN_USE_MDFILE_AS_MAINPAGE ${CMAKE_SOURCE_DIR}/readme.md) set(DOXYGEN_EXAMPLE_PATH ${CMAKE_SOURCE_DIR}) -set(DOXYGENT_DOT_TRANSPARENT YES) +set(DOXYGEN_DOT_TRANSPARENT YES) +set(DOXYGEN_IMAGE_PATH ${CMAKE_SOURCE_DIR}) # ============================================================================== # Doxygen Awesome CSS diff --git a/readme.md b/readme.md index 67e7f90..3102e9e 100644 --- a/readme.md +++ b/readme.md @@ -44,6 +44,9 @@ The [Rule of Cheese](https://github.com/JPenuchot/rule-of-cheese) project can be used as an example of how to use `ctbench`. It is the project that gave birth to this tool and is maintained as `ctbench` evolves. +You may refer to the [CMake API reference](generated-docs/ctbench-api.md) for +more details. + ### Declaring a benchmark case target A benchmark case is represented by a C++ file. It will be "instanciated", ie. @@ -157,6 +160,19 @@ per benchmark case. In this case, you would then get 3 graphs (`ExecuteCompiler`, `Frontend`, and `Backend`) each with 5 curves (`enable_if`, `enable_if_t`, `if_constexpr`, `control`, and `requires`). +### Examples + +![](docs/images/ExecuteCompiler.svg) +**Clang ExecuteCompiler time curve from +[poacher](https://github.com/jpenuchot/poacher), +generated by the *compare_by* plotter** + +![](docs/images/InstantiateFunction.svg) + +**Clang InstantiateFunction time curve from +[poacher](https://github.com/jpenuchot/poacher), +generated by the *compare_by* plotter** + ## Additional - [ctbench: compile time benchmarking for Clang]( From 15339efdfe707a1d6ac3ef195c7c88b62dd078e3 Mon Sep 17 00:00:00 2001 From: Jules P?nuchot Date: Wed, 7 Dec 2022 17:01:42 +0100 Subject: [PATCH 8/8] Added two example graphs for the readme --- docs/images/ExecuteCompiler.svg | 677 ++++++++++++++++++++++++++++ docs/images/InstantiateFunction.svg | 656 +++++++++++++++++++++++++++ 2 files changed, 1333 insertions(+) create mode 100644 docs/images/ExecuteCompiler.svg create mode 100644 docs/images/InstantiateFunction.svg diff --git a/docs/images/ExecuteCompiler.svg b/docs/images/ExecuteCompiler.svg new file mode 100644 index 0000000..d9e36b9 --- /dev/null +++ b/docs/images/ExecuteCompiler.svg @@ -0,0 +1,677 @@ + + + +Gnuplot +Produced by GNUPLOT 5.4 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Time (µs) + + + + + Benchmark size factor + + + + + bfbench-consecutiveloops-et + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bfbench-consecutiveloops-et + + + + bfbench-consecutiveloops-flat + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bfbench-consecutiveloops-flat + + + + bfbench-imbricatedloops-et + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bfbench-imbricatedloops-et + + + + bfbench-imbricatedloops-flat + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bfbench-imbricatedloops-flat + + + + + + + Timings + + + + + bfbench-consecutiveloops-et + + + bfbench-consecutiveloops-et + + + + + + + bfbench-consecutiveloops-et + + + bfbench-consecutiveloops-et + + + + + + bfbench-consecutiveloops-flat + + + bfbench-consecutiveloops-flat + + + + + + + bfbench-consecutiveloops-flat + + + bfbench-consecutiveloops-flat + + + + + + bfbench-imbricatedloops-et + + + bfbench-imbricatedloops-et + + + + + + + bfbench-imbricatedloops-et + + + bfbench-imbricatedloops-et + + + + + + bfbench-imbricatedloops-flat + + + bfbench-imbricatedloops-flat + + + + + + + bfbench-imbricatedloops-flat + + + bfbench-imbricatedloops-flat + + + + + + + + 1×106 + + + + + 2×106 + + + + + 3×106 + + + + + 4×106 + + + + + 5×106 + + + + + 6×106 + + + + + 7×106 + + + + + 8×106 + + + + + 9×106 + + + + + 1×107 + + + + + 1.1×107 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + + + + + + + + + diff --git a/docs/images/InstantiateFunction.svg b/docs/images/InstantiateFunction.svg new file mode 100644 index 0000000..b688044 --- /dev/null +++ b/docs/images/InstantiateFunction.svg @@ -0,0 +1,656 @@ + + + +Gnuplot +Produced by GNUPLOT 5.4 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Time (µs) + + + + + Benchmark size factor + + + + + bfbench-consecutiveloops-et + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bfbench-consecutiveloops-et + + + + bfbench-consecutiveloops-flat + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bfbench-consecutiveloops-flat + + + + bfbench-imbricatedloops-et + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bfbench-imbricatedloops-et + + + + bfbench-imbricatedloops-flat + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bfbench-imbricatedloops-flat + + + + + + + Timings + + + + + bfbench-consecutiveloops-et + + + bfbench-consecutiveloops-et + + + + + + + bfbench-consecutiveloops-et + + + bfbench-consecutiveloops-et + + + + + + bfbench-consecutiveloops-flat + + + bfbench-consecutiveloops-flat + + + + + + + bfbench-consecutiveloops-flat + + + bfbench-consecutiveloops-flat + + + + + + bfbench-imbricatedloops-et + + + bfbench-imbricatedloops-et + + + + + + + bfbench-imbricatedloops-et + + + bfbench-imbricatedloops-et + + + + + + bfbench-imbricatedloops-flat + + + bfbench-imbricatedloops-flat + + + + + + + bfbench-imbricatedloops-flat + + + bfbench-imbricatedloops-flat + + + + + + + + 100000 + + + + + 200000 + + + + + 300000 + + + + + 400000 + + + + + 500000 + + + + + 600000 + + + + + 700000 + + + + + 800000 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + + + + + + + + +