mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-01 03:14:29 +02:00
ratio metabench tests updated
This commit is contained in:
@@ -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
|
||||
|
@@ -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<r1, r2>;
|
||||
using r4 = stde::units::ratio_divide<r1, r2>;
|
||||
|
||||
using r5 = stde::units::common_ratio_t<r1, r2>;
|
||||
#else
|
||||
using r1 = void;
|
||||
using r2 = void;
|
||||
using r3 = void;
|
||||
using r4 = void;
|
||||
using r5 = void;
|
||||
#endif
|
||||
};
|
||||
<% end %>
|
||||
|
@@ -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<r1, r2>;
|
||||
using r4 = std::ratio_divide<r1, r2>;
|
||||
|
||||
using r5 = stde::units::common_ratio_t<r1, r2>;
|
||||
#else
|
||||
using r1 = void;
|
||||
using r2 = void;
|
||||
using r3 = void;
|
||||
using r4 = void;
|
||||
using r5 = void;
|
||||
#endif
|
||||
};
|
||||
<% end %>
|
||||
|
@@ -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<r1, r2>;
|
||||
using r4 = stde::units::ratio_divide<r1, r2>;
|
||||
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<r1, r2>;
|
||||
using r3 = stde::units::common_ratio_t<r1, r2>;
|
||||
#else
|
||||
using r3 = void;
|
||||
#endif
|
||||
};
|
||||
<% end %>
|
||||
|
@@ -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<r1, r2>;
|
||||
using r4 = std::ratio_divide<r1, r2>;
|
||||
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<r1, r2>;
|
||||
using r3 = stde::units::common_ratio_t<r1, r2>;
|
||||
#else
|
||||
using r3 = void;
|
||||
#endif
|
||||
};
|
||||
<% end %>
|
||||
|
@@ -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 %>
|
||||
|
@@ -1,12 +1,13 @@
|
||||
#include "std_ratio.h"
|
||||
|
||||
namespace stde = std::experimental;
|
||||
#include <ratio>
|
||||
|
||||
<% (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 %>
|
||||
|
@@ -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<r1, r2>;
|
||||
using r4 = stde::units::ratio_divide<r1, r2>;
|
||||
#else
|
||||
using r3 = void;
|
||||
using r4 = void;
|
||||
#endif
|
||||
};
|
||||
<% end %>
|
||||
|
@@ -1,15 +1,16 @@
|
||||
#include "std_ratio.h"
|
||||
|
||||
namespace stde = std::experimental;
|
||||
#include <ratio>
|
||||
|
||||
<% (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<r1, r2>;
|
||||
using r4 = std::ratio_divide<r1, r2>;
|
||||
#else
|
||||
using r3 = void;
|
||||
using r4 = void;
|
||||
#endif
|
||||
};
|
||||
<% end %>
|
||||
|
Reference in New Issue
Block a user