diff options
Diffstat (limited to 'src/boost/libs/hana/benchmark/sort')
6 files changed, 101 insertions, 0 deletions
diff --git a/src/boost/libs/hana/benchmark/sort/compile.erb.json b/src/boost/libs/hana/benchmark/sort/compile.erb.json new file mode 100644 index 000000000..1a13543bc --- /dev/null +++ b/src/boost/libs/hana/benchmark/sort/compile.erb.json @@ -0,0 +1,31 @@ +<% + hana = [0, 1, 2, 5, 10, 20, 50, 100] +%> + +{ + "title": { + "text": "Compile-time behavior of sort" + }, + "series": [ + { + "name": "hana::tuple::sorted", + "data": <%= time_compilation('compile.hana.tuple.sorted.erb.cpp', hana) %> + }, + { + "name": "hana::tuple::reversed", + "data": <%= time_compilation('compile.hana.tuple.reversed.erb.cpp', hana) %> + }, + { + "name": "hana::tuple::rand", + "data": <%= time_compilation('compile.hana.tuple.rand.erb.cpp', hana) %> + }, + { + "name": "hana::tuple::sorted_but_first", + "data": <%= time_compilation('compile.hana.tuple.sorted_but_first.erb.cpp', hana) %> + }, + { + "name": "hana::tuple::sorted_but_last", + "data": <%= time_compilation('compile.hana.tuple.sorted_but_last.erb.cpp', hana) %> + } + ] +} diff --git a/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.rand.erb.cpp b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.rand.erb.cpp new file mode 100644 index 000000000..771a1ffaf --- /dev/null +++ b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.rand.erb.cpp @@ -0,0 +1,14 @@ +// Copyright Louis Dionne 2013-2017 +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + +#include <boost/hana/tuple.hpp> +#include <boost/hana/sort.hpp> + +int main() { + constexpr auto tuple = boost::hana::make_tuple( + <%= (1..input_size).to_a.shuffle.map { |n| "boost::hana::int_c<#{n}>" }.join(', ') %> + ); + constexpr auto result = boost::hana::sort(tuple); + (void)result; +} diff --git a/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.reversed.erb.cpp b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.reversed.erb.cpp new file mode 100644 index 000000000..6fc85758f --- /dev/null +++ b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.reversed.erb.cpp @@ -0,0 +1,14 @@ +// Copyright Louis Dionne 2013-2017 +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + +#include <boost/hana/tuple.hpp> +#include <boost/hana/sort.hpp> + +int main() { + constexpr auto tuple = boost::hana::make_tuple( + <%= (1..input_size).to_a.reverse.map { |n| "boost::hana::int_c<#{n}>" }.join(', ') %> + ); + constexpr auto result = boost::hana::sort(tuple); + (void)result; +} diff --git a/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.sorted.erb.cpp b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.sorted.erb.cpp new file mode 100644 index 000000000..c48becf05 --- /dev/null +++ b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.sorted.erb.cpp @@ -0,0 +1,14 @@ +// Copyright Louis Dionne 2013-2017 +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + +#include <boost/hana/tuple.hpp> +#include <boost/hana/sort.hpp> + +int main() { + constexpr auto tuple = boost::hana::make_tuple( + <%= (1..input_size).map { |n| "boost::hana::int_c<#{n}>" }.join(', ') %> + ); + constexpr auto result = boost::hana::sort(tuple); + (void)result; +} diff --git a/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.sorted_but_first.erb.cpp b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.sorted_but_first.erb.cpp new file mode 100644 index 000000000..14795621f --- /dev/null +++ b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.sorted_but_first.erb.cpp @@ -0,0 +1,14 @@ +// Copyright Louis Dionne 2013-2017 +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + +#include <boost/hana/tuple.hpp> +#include <boost/hana/sort.hpp> + +int main() { + constexpr auto tuple = boost::hana::make_tuple( + <%= ([input_size+1] + (1..input_size).to_a).map { |n| "boost::hana::int_c<#{n}>" }.join(', ') %> + ); + constexpr auto result = boost::hana::sort(tuple); + (void)result; +} diff --git a/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.sorted_but_last.erb.cpp b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.sorted_but_last.erb.cpp new file mode 100644 index 000000000..5ed14ab7c --- /dev/null +++ b/src/boost/libs/hana/benchmark/sort/compile.hana.tuple.sorted_but_last.erb.cpp @@ -0,0 +1,14 @@ +// Copyright Louis Dionne 2013-2017 +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + +#include <boost/hana/tuple.hpp> +#include <boost/hana/sort.hpp> + +int main() { + constexpr auto tuple = boost::hana::make_tuple( + <%= ((1..input_size).to_a + [0]).map { |n| "boost::hana::int_c<#{n}>" }.join(', ') %> + ); + constexpr auto result = boost::hana::sort(tuple); + (void)result; +} |