diff options
Diffstat (limited to 'src/boost/libs/hana/benchmark/make')
10 files changed, 200 insertions, 0 deletions
diff --git a/src/boost/libs/hana/benchmark/make/compile.erb.json b/src/boost/libs/hana/benchmark/make/compile.erb.json new file mode 100644 index 000000000..24166876d --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.erb.json @@ -0,0 +1,58 @@ +<% + hana = (0...50).step(5).to_a + (50..400).step(25).to_a + fusion = (0...50).step(5).to_a + [50, 75, 100] + mpl = hana + meta = (0...50).step(5).to_a + (50..200).step(25).to_a + mpl11 = hana + std = (0...50).step(5).to_a + (50..100).step(25).to_a +%> + +{ + "title": { + "text": "Compile-time behavior of creating a sequence" + }, + "series": [ + { + "name": "hana::tuple", + "data": <%= time_compilation('compile.hana.tuple.erb.cpp', hana) %> + }, { + "name": "hana::basic_tuple", + "data": <%= time_compilation('compile.hana.basic_tuple.erb.cpp', hana) %> + }, { + "name": "std::array", + "data": <%= time_compilation('compile.std.array.erb.cpp', hana) %> + } + + , { + "name": "std::tuple", + "data": <%= time_compilation('compile.std.tuple.erb.cpp', std) %> + } + + <% if cmake_bool("@Boost_FOUND@") %> + , { + "name": "fusion::vector", + "data": <%= time_compilation('compile.fusion.vector.erb.cpp', fusion) %> + }, { + "name": "fusion::list", + "data": <%= time_compilation('compile.fusion.list.erb.cpp', fusion) %> + }, { + "name": "mpl::vector", + "data": <%= time_compilation('compile.mpl.vector.erb.cpp', mpl) %> + } + <% end %> + + <% if cmake_bool("@Meta_FOUND@") %> + , { + "name": "meta::list", + "data": <%= time_compilation('compile.meta.list.erb.cpp', meta) %> + } + <% end %> + + <% if cmake_bool("@MPL11_FOUND@") %> + , { + "name": "mpl11::list", + "data": <%= time_compilation('compile.mpl11.list.erb.cpp', mpl11) %> + } + <% end %> + ] +} diff --git a/src/boost/libs/hana/benchmark/make/compile.fusion.list.erb.cpp b/src/boost/libs/hana/benchmark/make/compile.fusion.list.erb.cpp new file mode 100644 index 000000000..7274375a8 --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.fusion.list.erb.cpp @@ -0,0 +1,15 @@ +// 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/fusion/include/make_list.hpp> +#include <boost/fusion/include/push_back.hpp> + + +template <int i> +struct x { }; + +int main() { + auto xs = <%= fusion_list((1..input_size).map { |n| "x<#{n}>{}" }) %>; + (void)xs; +} diff --git a/src/boost/libs/hana/benchmark/make/compile.fusion.vector.erb.cpp b/src/boost/libs/hana/benchmark/make/compile.fusion.vector.erb.cpp new file mode 100644 index 000000000..fd3794b34 --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.fusion.vector.erb.cpp @@ -0,0 +1,15 @@ +// 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/fusion/include/make_vector.hpp> +#include <boost/fusion/include/push_back.hpp> + + +template <int i> +struct x { }; + +int main() { + auto vector = <%= fusion_vector((1..input_size).map { |n| "x<#{n}>{}" }) %>; + (void)vector; +} diff --git a/src/boost/libs/hana/benchmark/make/compile.hana.basic_tuple.erb.cpp b/src/boost/libs/hana/benchmark/make/compile.hana.basic_tuple.erb.cpp new file mode 100644 index 000000000..a04016a4c --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.hana.basic_tuple.erb.cpp @@ -0,0 +1,16 @@ +// 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/basic_tuple.hpp> + + +template <int i> +struct x { }; + +int main() { + constexpr auto tuple = boost::hana::make_basic_tuple( + <%= (1..input_size).map { |n| "x<#{n}>{}" }.join(', ') %> + ); + (void)tuple; +} diff --git a/src/boost/libs/hana/benchmark/make/compile.hana.tuple.erb.cpp b/src/boost/libs/hana/benchmark/make/compile.hana.tuple.erb.cpp new file mode 100644 index 000000000..34ce368e3 --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.hana.tuple.erb.cpp @@ -0,0 +1,16 @@ +// 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> + + +template <int i> +struct x { }; + +int main() { + constexpr auto tuple = boost::hana::make_tuple( + <%= (1..input_size).map { |n| "x<#{n}>{}" }.join(', ') %> + ); + (void)tuple; +} diff --git a/src/boost/libs/hana/benchmark/make/compile.meta.list.erb.cpp b/src/boost/libs/hana/benchmark/make/compile.meta.list.erb.cpp new file mode 100644 index 000000000..f90fef99b --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.meta.list.erb.cpp @@ -0,0 +1,17 @@ +// 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 <meta/meta.hpp> + + +template <int> +struct x; + +using list = meta::list< + <%= (1..input_size).map { |i| "x<#{i}>" }.join(', ') %> +>; + +int main() { + +} diff --git a/src/boost/libs/hana/benchmark/make/compile.mpl.vector.erb.cpp b/src/boost/libs/hana/benchmark/make/compile.mpl.vector.erb.cpp new file mode 100644 index 000000000..4b7d94c53 --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.mpl.vector.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/mpl/push_back.hpp> +#include <boost/mpl/vector.hpp> + + +template <int i> +struct t { }; + +using vector = <%= mpl_vector((1..input_size).to_a.map { |n| "t<#{n}>" }) %>; + +int main() { } diff --git a/src/boost/libs/hana/benchmark/make/compile.mpl11.list.erb.cpp b/src/boost/libs/hana/benchmark/make/compile.mpl11.list.erb.cpp new file mode 100644 index 000000000..79d0c697d --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.mpl11.list.erb.cpp @@ -0,0 +1,17 @@ +// 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/mpl11/list.hpp> + + +template <int> +struct x; + +using list = boost::mpl11::list< + <%= (1..input_size).map { |i| "x<#{i}>" }.join(', ') %> +>; + +int main() { + +} diff --git a/src/boost/libs/hana/benchmark/make/compile.std.array.erb.cpp b/src/boost/libs/hana/benchmark/make/compile.std.array.erb.cpp new file mode 100644 index 000000000..792ec4848 --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.std.array.erb.cpp @@ -0,0 +1,16 @@ +// 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 <array> + + +template <int i> +struct x { }; + +int main() { + constexpr std::array<int, <%= input_size %>> array = {{ + <%= (1..input_size).to_a.join(', ') %> + }}; + (void)array; +} diff --git a/src/boost/libs/hana/benchmark/make/compile.std.tuple.erb.cpp b/src/boost/libs/hana/benchmark/make/compile.std.tuple.erb.cpp new file mode 100644 index 000000000..11fc7cd85 --- /dev/null +++ b/src/boost/libs/hana/benchmark/make/compile.std.tuple.erb.cpp @@ -0,0 +1,16 @@ +// 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 <tuple> + + +template <int i> +struct x { }; + +int main() { + constexpr auto tuple = std::make_tuple( + <%= (1..input_size).map { |n| "x<#{n}>{}" }.join(', ') %> + ); + (void)tuple; +} |