mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 03:44:27 +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]")
|
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
|
metabench_add_chart(metabench.chart.ratio.create
|
||||||
TITLE "Creation on 2*N ratios"
|
TITLE "Creation on 2*N ratios"
|
||||||
SUBTITLE "(smaller is better)"
|
SUBTITLE "(lower is better)"
|
||||||
DATASETS
|
DATASETS
|
||||||
metabench.data.ratio.create.std_ratio
|
metabench.data.ratio.create.std_ratio
|
||||||
metabench.data.ratio.create.ratio_type_constexpr
|
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.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 with constexpr" all_ratio_type_constexpr.cpp.erb "[10, 50, 100, 500, 1000]")
|
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
|
metabench_add_chart(metabench.chart.ratio.multiply_divide
|
||||||
TITLE "N ratio multiply + divide operations"
|
TITLE "N ratio multiply + divide operations"
|
||||||
SUBTITLE "(smaller is better)"
|
SUBTITLE "(lower is better)"
|
||||||
DATASETS
|
DATASETS
|
||||||
metabench.data.ratio.multiply_divide.std_ratio
|
metabench.data.ratio.multiply_divide.std_ratio
|
||||||
metabench.data.ratio.multiply_divide.ratio_type_constexpr
|
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.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 with constexpr" all_ratio_type_constexpr.cpp.erb "[10, 50, 100, 500, 1000]")
|
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
|
metabench_add_chart(metabench.chart.ratio.common_ratio
|
||||||
TITLE "N common_ratio operations"
|
TITLE "N common_ratio operations"
|
||||||
SUBTITLE "(smaller is better)"
|
SUBTITLE "(lower is better)"
|
||||||
DATASETS
|
DATASETS
|
||||||
metabench.data.ratio.common_ratio.std_ratio
|
metabench.data.ratio.common_ratio.std_ratio
|
||||||
metabench.data.ratio.common_ratio.ratio_type_constexpr
|
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]")
|
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
|
metabench_add_chart(metabench.chart.ratio.all
|
||||||
TITLE "N x all ratio operations"
|
TITLE "N x all ratio operations"
|
||||||
SUBTITLE "(smaller is better)"
|
SUBTITLE "(lower is better)"
|
||||||
DATASETS
|
DATASETS
|
||||||
metabench.data.ratio.all.std_ratio
|
metabench.data.ratio.all.std_ratio
|
||||||
metabench.data.ratio.all.ratio_type_constexpr
|
metabench.data.ratio.all.ratio_type_constexpr
|
||||||
|
@@ -5,13 +5,19 @@ namespace stde = std::experimental;
|
|||||||
<% (1..n).each do |i| %>
|
<% (1..n).each do |i| %>
|
||||||
struct test<%= i %> {
|
struct test<%= i %> {
|
||||||
#if defined(METABENCH)
|
#if defined(METABENCH)
|
||||||
using r1 = stde::units::ratio<<%= i %>, <%= n + 1 - i %>>;
|
using r1 = stde::units::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>;
|
||||||
using r2 = stde::units::ratio<<%= n + 1 - i %>, <%= i %>>;
|
using r2 = stde::units::ratio<<%= 2 * i %>, <%= 2 * n %>>;
|
||||||
|
|
||||||
using r3 = stde::units::ratio_multiply<r1, r2>;
|
using r3 = stde::units::ratio_multiply<r1, r2>;
|
||||||
using r4 = stde::units::ratio_divide<r1, r2>;
|
using r4 = stde::units::ratio_divide<r1, r2>;
|
||||||
|
|
||||||
using r5 = stde::units::common_ratio_t<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
|
#endif
|
||||||
};
|
};
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@@ -5,13 +5,19 @@ namespace stde = std::experimental;
|
|||||||
<% (1..n).each do |i| %>
|
<% (1..n).each do |i| %>
|
||||||
struct test<%= i %> {
|
struct test<%= i %> {
|
||||||
#if defined(METABENCH)
|
#if defined(METABENCH)
|
||||||
using r1 = std::ratio<<%= i %>, <%= n + 1 - i %>>;
|
using r1 = std::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>;
|
||||||
using r2 = std::ratio<<%= n + 1 - i %>, <%= i %>>;
|
using r2 = std::ratio<<%= 2 * i %>, <%= 2 * n %>>;
|
||||||
|
|
||||||
using r3 = std::ratio_multiply<r1, r2>;
|
using r3 = std::ratio_multiply<r1, r2>;
|
||||||
using r4 = std::ratio_divide<r1, r2>;
|
using r4 = std::ratio_divide<r1, r2>;
|
||||||
|
|
||||||
using r5 = stde::units::common_ratio_t<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
|
#endif
|
||||||
};
|
};
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@@ -4,14 +4,13 @@ namespace stde = std::experimental;
|
|||||||
|
|
||||||
<% (1..n).each do |i| %>
|
<% (1..n).each do |i| %>
|
||||||
struct test<%= i %> {
|
struct test<%= i %> {
|
||||||
using r1 = stde::units::ratio<<%= i %>, <%= n + 1 - i %>>;
|
using r1 = stde::units::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>;
|
||||||
using r2 = stde::units::ratio<<%= n + 1 - i %>, <%= i %>>;
|
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>;
|
|
||||||
|
|
||||||
#if defined(METABENCH)
|
#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
|
#endif
|
||||||
};
|
};
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@@ -4,14 +4,13 @@ namespace stde = std::experimental;
|
|||||||
|
|
||||||
<% (1..n).each do |i| %>
|
<% (1..n).each do |i| %>
|
||||||
struct test<%= i %> {
|
struct test<%= i %> {
|
||||||
using r1 = std::ratio<<%= i %>, <%= n + 1 - i %>>;
|
using r1 = std::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>;
|
||||||
using r2 = std::ratio<<%= n + 1 - i %>, <%= i %>>;
|
using r2 = std::ratio<<%= 2 * i %>, <%= 2 * n %>>;
|
||||||
|
|
||||||
using r3 = std::ratio_multiply<r1, r2>;
|
|
||||||
using r4 = std::ratio_divide<r1, r2>;
|
|
||||||
|
|
||||||
#if defined(METABENCH)
|
#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
|
#endif
|
||||||
};
|
};
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@@ -5,8 +5,11 @@ namespace stde = std::experimental;
|
|||||||
<% (1..n).each do |i| %>
|
<% (1..n).each do |i| %>
|
||||||
struct test<%= i %> {
|
struct test<%= i %> {
|
||||||
#if defined(METABENCH)
|
#if defined(METABENCH)
|
||||||
using r1 = stde::units::ratio<<%= i %>, <%= n + 1 - i %>>;
|
using r1 = stde::units::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>;
|
||||||
using r2 = stde::units::ratio<<%= n + 1 - i %>, <%= i %>>;
|
using r2 = stde::units::ratio<<%= 2 * i %>, <%= 2 * n %>>;
|
||||||
|
#else
|
||||||
|
using r1 = void;
|
||||||
|
using r2 = void;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
#include "std_ratio.h"
|
#include <ratio>
|
||||||
|
|
||||||
namespace stde = std::experimental;
|
|
||||||
|
|
||||||
<% (1..n).each do |i| %>
|
<% (1..n).each do |i| %>
|
||||||
struct test<%= i %> {
|
struct test<%= i %> {
|
||||||
#if defined(METABENCH)
|
#if defined(METABENCH)
|
||||||
using r1 = std::ratio<<%= i %>, <%= n + 1 - i %>>;
|
using r1 = std::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>;
|
||||||
using r2 = std::ratio<<%= n + 1 - i %>, <%= i %>>;
|
using r2 = std::ratio<<%= 2 * i %>, <%= 2 * n %>>;
|
||||||
|
#else
|
||||||
|
using r1 = void;
|
||||||
|
using r2 = void;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@@ -4,12 +4,15 @@ namespace stde = std::experimental;
|
|||||||
|
|
||||||
<% (1..n).each do |i| %>
|
<% (1..n).each do |i| %>
|
||||||
struct test<%= i %> {
|
struct test<%= i %> {
|
||||||
using r1 = stde::units::ratio<<%= i %>, <%= n + 1 - i %>>;
|
using r1 = stde::units::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>;
|
||||||
using r2 = stde::units::ratio<<%= n + 1 - i %>, <%= i %>>;
|
using r2 = stde::units::ratio<<%= 2 * i %>, <%= 2 * n %>>;
|
||||||
|
|
||||||
#if defined(METABENCH)
|
#if defined(METABENCH)
|
||||||
using r3 = stde::units::ratio_multiply<r1, r2>;
|
using r3 = stde::units::ratio_multiply<r1, r2>;
|
||||||
using r4 = stde::units::ratio_divide<r1, r2>;
|
using r4 = stde::units::ratio_divide<r1, r2>;
|
||||||
|
#else
|
||||||
|
using r3 = void;
|
||||||
|
using r4 = void;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@@ -1,15 +1,16 @@
|
|||||||
#include "std_ratio.h"
|
#include <ratio>
|
||||||
|
|
||||||
namespace stde = std::experimental;
|
|
||||||
|
|
||||||
<% (1..n).each do |i| %>
|
<% (1..n).each do |i| %>
|
||||||
struct test<%= i %> {
|
struct test<%= i %> {
|
||||||
using r1 = std::ratio<<%= i %>, <%= n + 1 - i %>>;
|
using r1 = std::ratio<<%= 2 * i - 1 %>, <%= 2 * n %>>;
|
||||||
using r2 = std::ratio<<%= n + 1 - i %>, <%= i %>>;
|
using r2 = std::ratio<<%= 2 * i %>, <%= 2 * n %>>;
|
||||||
|
|
||||||
#if defined(METABENCH)
|
#if defined(METABENCH)
|
||||||
using r3 = std::ratio_multiply<r1, r2>;
|
using r3 = std::ratio_multiply<r1, r2>;
|
||||||
using r4 = std::ratio_divide<r1, r2>;
|
using r4 = std::ratio_divide<r1, r2>;
|
||||||
|
#else
|
||||||
|
using r3 = void;
|
||||||
|
using r4 = void;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
<% end %>
|
<% end %>
|
||||||
|
Reference in New Issue
Block a user