diff --git a/test/metabench/ratio/CMakeLists.txt b/test/metabench/ratio/CMakeLists.txt index 232eef44..6cc7ebb8 100644 --- a/test/metabench/ratio/CMakeLists.txt +++ b/test/metabench/ratio/CMakeLists.txt @@ -25,27 +25,27 @@ add_metabench_test(metabench.data.ratio.create.std_ratio "std::ratio" create_std add_metabench_test(metabench.data.ratio.create.ratio_type_constexpr "ratio with constexpr" create_ratio_type_constexpr.cpp.erb "[1000, 2500, 5000, 7500, 10000]") metabench_add_chart(metabench.chart.ratio.create TITLE "Creation on 2*N ratios" - SUBTITLE "(smaller is better)" + SUBTITLE "(lower is better)" DATASETS metabench.data.ratio.create.std_ratio metabench.data.ratio.create.ratio_type_constexpr ) -add_metabench_test(metabench.data.ratio.multiply_divide.std_ratio "std::ratio" all_std_ratio.cpp.erb "[10, 50, 100, 500, 1000]") -add_metabench_test(metabench.data.ratio.multiply_divide.ratio_type_constexpr "ratio with constexpr" all_ratio_type_constexpr.cpp.erb "[10, 50, 100, 500, 1000]") +add_metabench_test(metabench.data.ratio.multiply_divide.std_ratio "std::ratio" multiply_divide_std_ratio.cpp.erb "[10, 50, 100, 250, 500, 750, 1000, 1500, 2000, 3000, 4000, 5000]") +add_metabench_test(metabench.data.ratio.multiply_divide.ratio_type_constexpr "ratio constexpr" multiply_divide_ratio_type_constexpr.cpp.erb "[10, 50, 100, 250, 500, 750, 1000, 1500, 2000, 3000, 4000, 5000]") metabench_add_chart(metabench.chart.ratio.multiply_divide TITLE "N ratio multiply + divide operations" - SUBTITLE "(smaller is better)" + SUBTITLE "(lower is better)" DATASETS metabench.data.ratio.multiply_divide.std_ratio metabench.data.ratio.multiply_divide.ratio_type_constexpr ) -add_metabench_test(metabench.data.ratio.common_ratio.std_ratio "std::ratio" all_std_ratio.cpp.erb "[10, 50, 100, 500, 1000]") -add_metabench_test(metabench.data.ratio.common_ratio.ratio_type_constexpr "ratio with constexpr" all_ratio_type_constexpr.cpp.erb "[10, 50, 100, 500, 1000]") +add_metabench_test(metabench.data.ratio.common_ratio.std_ratio "std::ratio" common_ratio_std_ratio.cpp.erb "[10, 50, 100, 250, 500, 750, 1000, 1500, 2000, 3000, 4000, 5000]") +add_metabench_test(metabench.data.ratio.common_ratio.ratio_type_constexpr "ratio constexpr" common_ratio_ratio_type_constexpr.cpp.erb "[10, 50, 100, 250, 500, 750, 1000, 1500, 2000, 3000, 4000, 5000]") metabench_add_chart(metabench.chart.ratio.common_ratio TITLE "N common_ratio operations" - SUBTITLE "(smaller is better)" + SUBTITLE "(lower is better)" DATASETS metabench.data.ratio.common_ratio.std_ratio metabench.data.ratio.common_ratio.ratio_type_constexpr @@ -55,7 +55,7 @@ add_metabench_test(metabench.data.ratio.all.std_ratio "std::ratio" all_std_ratio add_metabench_test(metabench.data.ratio.all.ratio_type_constexpr "ratio with constexpr" all_ratio_type_constexpr.cpp.erb "[10, 50, 100, 500, 1000]") metabench_add_chart(metabench.chart.ratio.all TITLE "N x all ratio operations" - SUBTITLE "(smaller is better)" + SUBTITLE "(lower is better)" DATASETS metabench.data.ratio.all.std_ratio metabench.data.ratio.all.ratio_type_constexpr diff --git a/test/metabench/ratio/all_ratio_type_constexpr.cpp.erb b/test/metabench/ratio/all_ratio_type_constexpr.cpp.erb index 2e98e10d..9192ab86 100644 --- a/test/metabench/ratio/all_ratio_type_constexpr.cpp.erb +++ b/test/metabench/ratio/all_ratio_type_constexpr.cpp.erb @@ -5,13 +5,19 @@ namespace stde = std::experimental; <% (1..n).each do |i| %> struct test<%= i %> { #if defined(METABENCH) - using r1 = stde::units::ratio<<%= i %>, <%= n + 1 - i %>>; - using r2 = stde::units::ratio<<%= n + 1 - i %>, <%= i %>>; + using r1 = stde::units::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>; + using r2 = stde::units::ratio<<%= 2 * i %>, <%= 2 * n %>>; using r3 = stde::units::ratio_multiply; using r4 = stde::units::ratio_divide; using r5 = stde::units::common_ratio_t; +#else + using r1 = void; + using r2 = void; + using r3 = void; + using r4 = void; + using r5 = void; #endif }; <% end %> diff --git a/test/metabench/ratio/all_std_ratio.cpp.erb b/test/metabench/ratio/all_std_ratio.cpp.erb index 0848d4f9..71a51e29 100644 --- a/test/metabench/ratio/all_std_ratio.cpp.erb +++ b/test/metabench/ratio/all_std_ratio.cpp.erb @@ -5,13 +5,19 @@ namespace stde = std::experimental; <% (1..n).each do |i| %> struct test<%= i %> { #if defined(METABENCH) - using r1 = std::ratio<<%= i %>, <%= n + 1 - i %>>; - using r2 = std::ratio<<%= n + 1 - i %>, <%= i %>>; + using r1 = std::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>; + using r2 = std::ratio<<%= 2 * i %>, <%= 2 * n %>>; using r3 = std::ratio_multiply; using r4 = std::ratio_divide; using r5 = stde::units::common_ratio_t; +#else + using r1 = void; + using r2 = void; + using r3 = void; + using r4 = void; + using r5 = void; #endif }; <% end %> diff --git a/test/metabench/ratio/common_ratio_ratio_type_constexpr.cpp.erb b/test/metabench/ratio/common_ratio_ratio_type_constexpr.cpp.erb index 89c5a6a1..cdc1dcf8 100644 --- a/test/metabench/ratio/common_ratio_ratio_type_constexpr.cpp.erb +++ b/test/metabench/ratio/common_ratio_ratio_type_constexpr.cpp.erb @@ -4,14 +4,13 @@ namespace stde = std::experimental; <% (1..n).each do |i| %> struct test<%= i %> { - using r1 = stde::units::ratio<<%= i %>, <%= n + 1 - i %>>; - using r2 = stde::units::ratio<<%= n + 1 - i %>, <%= i %>>; - - using r3 = stde::units::ratio_multiply; - using r4 = stde::units::ratio_divide; + using r1 = stde::units::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>; + using r2 = stde::units::ratio<<%= 2 * i %>, <%= 2 * n %>>; #if defined(METABENCH) - using r5 = stde::units::common_ratio_t; + using r3 = stde::units::common_ratio_t; +#else + using r3 = void; #endif }; <% end %> diff --git a/test/metabench/ratio/common_ratio_std_ratio.cpp.erb b/test/metabench/ratio/common_ratio_std_ratio.cpp.erb index 3df70151..115a8c7e 100644 --- a/test/metabench/ratio/common_ratio_std_ratio.cpp.erb +++ b/test/metabench/ratio/common_ratio_std_ratio.cpp.erb @@ -4,14 +4,13 @@ namespace stde = std::experimental; <% (1..n).each do |i| %> struct test<%= i %> { - using r1 = std::ratio<<%= i %>, <%= n + 1 - i %>>; - using r2 = std::ratio<<%= n + 1 - i %>, <%= i %>>; - - using r3 = std::ratio_multiply; - using r4 = std::ratio_divide; + using r1 = std::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>; + using r2 = std::ratio<<%= 2 * i %>, <%= 2 * n %>>; #if defined(METABENCH) - using r5 = stde::units::common_ratio_t; + using r3 = stde::units::common_ratio_t; +#else + using r3 = void; #endif }; <% end %> diff --git a/test/metabench/ratio/create_ratio_type_constexpr.cpp.erb b/test/metabench/ratio/create_ratio_type_constexpr.cpp.erb index 918e50b8..e9f245d8 100644 --- a/test/metabench/ratio/create_ratio_type_constexpr.cpp.erb +++ b/test/metabench/ratio/create_ratio_type_constexpr.cpp.erb @@ -5,8 +5,11 @@ namespace stde = std::experimental; <% (1..n).each do |i| %> struct test<%= i %> { #if defined(METABENCH) - using r1 = stde::units::ratio<<%= i %>, <%= n + 1 - i %>>; - using r2 = stde::units::ratio<<%= n + 1 - i %>, <%= i %>>; + using r1 = stde::units::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>; + using r2 = stde::units::ratio<<%= 2 * i %>, <%= 2 * n %>>; +#else + using r1 = void; + using r2 = void; #endif }; <% end %> diff --git a/test/metabench/ratio/create_std_ratio.cpp.erb b/test/metabench/ratio/create_std_ratio.cpp.erb index 038325e4..eafe36a1 100644 --- a/test/metabench/ratio/create_std_ratio.cpp.erb +++ b/test/metabench/ratio/create_std_ratio.cpp.erb @@ -1,12 +1,13 @@ -#include "std_ratio.h" - -namespace stde = std::experimental; +#include <% (1..n).each do |i| %> struct test<%= i %> { #if defined(METABENCH) - using r1 = std::ratio<<%= i %>, <%= n + 1 - i %>>; - using r2 = std::ratio<<%= n + 1 - i %>, <%= i %>>; + using r1 = std::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>; + using r2 = std::ratio<<%= 2 * i %>, <%= 2 * n %>>; +#else + using r1 = void; + using r2 = void; #endif }; <% end %> diff --git a/test/metabench/ratio/multiply_divide_ratio_type_constexpr.cpp.erb b/test/metabench/ratio/multiply_divide_ratio_type_constexpr.cpp.erb index 18499cb7..2adf0d4a 100644 --- a/test/metabench/ratio/multiply_divide_ratio_type_constexpr.cpp.erb +++ b/test/metabench/ratio/multiply_divide_ratio_type_constexpr.cpp.erb @@ -4,12 +4,15 @@ namespace stde = std::experimental; <% (1..n).each do |i| %> struct test<%= i %> { - using r1 = stde::units::ratio<<%= i %>, <%= n + 1 - i %>>; - using r2 = stde::units::ratio<<%= n + 1 - i %>, <%= i %>>; + using r1 = stde::units::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>; + using r2 = stde::units::ratio<<%= 2 * i %>, <%= 2 * n %>>; #if defined(METABENCH) using r3 = stde::units::ratio_multiply; using r4 = stde::units::ratio_divide; +#else + using r3 = void; + using r4 = void; #endif }; <% end %> diff --git a/test/metabench/ratio/multiply_divide_std_ratio.cpp.erb b/test/metabench/ratio/multiply_divide_std_ratio.cpp.erb index 0ae19648..5a5c2f17 100644 --- a/test/metabench/ratio/multiply_divide_std_ratio.cpp.erb +++ b/test/metabench/ratio/multiply_divide_std_ratio.cpp.erb @@ -1,15 +1,16 @@ -#include "std_ratio.h" - -namespace stde = std::experimental; +#include <% (1..n).each do |i| %> struct test<%= i %> { - using r1 = std::ratio<<%= i %>, <%= n + 1 - i %>>; - using r2 = std::ratio<<%= n + 1 - i %>, <%= i %>>; + using r1 = std::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>; + using r2 = std::ratio<<%= 2 * i %>, <%= 2 * n %>>; #if defined(METABENCH) using r3 = std::ratio_multiply; using r4 = std::ratio_divide; +#else + using r3 = void; + using r4 = void; #endif }; <% end %>