mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-13 11:17:06 +07:00
remove rttr submodule and rttr benches
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -10,6 +10,3 @@
|
||||
[submodule "develop/vendors/vmath.hpp"]
|
||||
path = develop/vendors/vmath.hpp
|
||||
url = https://github.com/BlackMATov/vmath.hpp
|
||||
[submodule "develop/vendors/rttr"]
|
||||
path = develop/vendors/rttr
|
||||
url = https://github.com/rttrorg/rttr
|
||||
|
||||
@@ -10,14 +10,12 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
meta.hpp::meta.hpp
|
||||
meta.hpp::setup_targets
|
||||
meta.hpp.vendors::gbench
|
||||
meta.hpp.vendors::rttr
|
||||
meta.hpp.vendors::vmath.hpp)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}.singles PRIVATE
|
||||
meta.hpp::singles
|
||||
meta.hpp::setup_targets
|
||||
meta.hpp.vendors::gbench
|
||||
meta.hpp.vendors::rttr
|
||||
meta.hpp.vendors::vmath.hpp)
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
#include <meta.hpp/meta_all.hpp>
|
||||
#include <vmath.hpp/vmath_all.hpp>
|
||||
|
||||
#include <rttr/type>
|
||||
#include <rttr/registration>
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
namespace
|
||||
@@ -27,23 +24,18 @@ namespace
|
||||
|
||||
base1(const base1&) = default;
|
||||
base1& operator=(const base1&) = default;
|
||||
|
||||
RTTR_ENABLE()
|
||||
};
|
||||
|
||||
struct base2 : base1 {
|
||||
unsigned b2{2};
|
||||
RTTR_ENABLE(base1)
|
||||
};
|
||||
|
||||
struct base3 : base2 {
|
||||
unsigned b3{3};
|
||||
RTTR_ENABLE(base2)
|
||||
};
|
||||
|
||||
struct base4 : base3 {
|
||||
unsigned b4{4};
|
||||
RTTR_ENABLE(base3)
|
||||
};
|
||||
|
||||
unsigned static_function_1(base1* b1) {
|
||||
@@ -90,16 +82,6 @@ namespace
|
||||
.function_("cast_function_4", &static_function_4);
|
||||
}
|
||||
|
||||
RTTR_REGISTRATION
|
||||
{
|
||||
using namespace rttr;
|
||||
|
||||
registration::method("cast_function_1", &static_function_1);
|
||||
registration::method("cast_function_2", &static_function_2);
|
||||
registration::method("cast_function_3", &static_function_3);
|
||||
registration::method("cast_function_4", &static_function_4);
|
||||
}
|
||||
|
||||
//
|
||||
// native
|
||||
//
|
||||
@@ -206,87 +188,14 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// rttr
|
||||
//
|
||||
|
||||
namespace
|
||||
{
|
||||
[[maybe_unused]]
|
||||
void rttr_cast_function_1(benchmark::State &state) {
|
||||
rttr::method m = rttr::type::get_global_method("cast_function_1");
|
||||
META_HPP_ASSERT(m.is_valid());
|
||||
|
||||
base4 b4;
|
||||
for ( auto _ : state ) {
|
||||
unsigned r = m.invoke({},
|
||||
rttr::rttr_cast<base1*>(&b4)).get_value<unsigned>();
|
||||
META_HPP_ASSERT(r == 1);
|
||||
benchmark::DoNotOptimize(r);
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_cast_function_2(benchmark::State &state) {
|
||||
rttr::method m = rttr::type::get_global_method("cast_function_2");
|
||||
META_HPP_ASSERT(m.is_valid());
|
||||
|
||||
base4 b4;
|
||||
for ( auto _ : state ) {
|
||||
unsigned r = m.invoke({},
|
||||
rttr::rttr_cast<base1*>(&b4),
|
||||
rttr::rttr_cast<base2*>(&b4)).get_value<unsigned>();
|
||||
META_HPP_ASSERT(r == 3);
|
||||
benchmark::DoNotOptimize(r);
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_cast_function_3(benchmark::State &state) {
|
||||
rttr::method m = rttr::type::get_global_method("cast_function_3");
|
||||
META_HPP_ASSERT(m.is_valid());
|
||||
|
||||
base4 b4;
|
||||
for ( auto _ : state ) {
|
||||
unsigned r = m.invoke({},
|
||||
rttr::rttr_cast<base1*>(&b4),
|
||||
rttr::rttr_cast<base2*>(&b4),
|
||||
rttr::rttr_cast<base3*>(&b4)).get_value<unsigned>();
|
||||
META_HPP_ASSERT(r == 6);
|
||||
benchmark::DoNotOptimize(r);
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_cast_function_4(benchmark::State &state) {
|
||||
rttr::method m = rttr::type::get_global_method("cast_function_4");
|
||||
META_HPP_ASSERT(m.is_valid());
|
||||
|
||||
base4 b4;
|
||||
for ( auto _ : state ) {
|
||||
unsigned r = m.invoke({},
|
||||
rttr::rttr_cast<base1*>(&b4),
|
||||
rttr::rttr_cast<base2*>(&b4),
|
||||
rttr::rttr_cast<base3*>(&b4),
|
||||
rttr::rttr_cast<base4*>(&b4)).get_value<unsigned>();
|
||||
META_HPP_ASSERT(r == 10);
|
||||
benchmark::DoNotOptimize(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(cast_function_1)->Teardown(static_function_reset);
|
||||
BENCHMARK(meta_cast_function_1)->Teardown(static_function_reset);
|
||||
BENCHMARK(rttr_cast_function_1)->Teardown(static_function_reset);
|
||||
|
||||
BENCHMARK(cast_function_2)->Teardown(static_function_reset);
|
||||
BENCHMARK(meta_cast_function_2)->Teardown(static_function_reset);
|
||||
BENCHMARK(rttr_cast_function_2)->Teardown(static_function_reset);
|
||||
|
||||
BENCHMARK(cast_function_3)->Teardown(static_function_reset);
|
||||
BENCHMARK(meta_cast_function_3)->Teardown(static_function_reset);
|
||||
BENCHMARK(rttr_cast_function_3)->Teardown(static_function_reset);
|
||||
|
||||
BENCHMARK(cast_function_4)->Teardown(static_function_reset);
|
||||
BENCHMARK(meta_cast_function_4)->Teardown(static_function_reset);
|
||||
BENCHMARK(rttr_cast_function_4)->Teardown(static_function_reset);
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
#include <meta.hpp/meta_all.hpp>
|
||||
#include <vmath.hpp/vmath_all.hpp>
|
||||
|
||||
#include <rttr/type>
|
||||
#include <rttr/registration>
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
namespace
|
||||
@@ -26,25 +23,21 @@ namespace
|
||||
base1(const base1&) = default;
|
||||
base1& operator=(const base1&) = default;
|
||||
|
||||
RTTR_ENABLE()
|
||||
META_HPP_ENABLE_POLY_INFO()
|
||||
};
|
||||
|
||||
struct base2 : base1 {
|
||||
unsigned b2{2};
|
||||
RTTR_ENABLE(base1)
|
||||
META_HPP_ENABLE_POLY_INFO()
|
||||
};
|
||||
|
||||
struct base3 : base2 {
|
||||
unsigned b3{3};
|
||||
RTTR_ENABLE(base2)
|
||||
META_HPP_ENABLE_POLY_INFO()
|
||||
};
|
||||
|
||||
struct base4 : base3 {
|
||||
unsigned b4{4};
|
||||
RTTR_ENABLE(base3)
|
||||
META_HPP_ENABLE_POLY_INFO()
|
||||
};
|
||||
|
||||
@@ -159,61 +152,14 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// rttr
|
||||
//
|
||||
|
||||
namespace
|
||||
{
|
||||
[[maybe_unused]]
|
||||
void rttr_dynamic_cast_1(benchmark::State &state) {
|
||||
base4 b4;
|
||||
for ( auto _ : state ) {
|
||||
base4* r = rttr::rttr_cast<base4*>(static_cast<base1*>(&b4));
|
||||
benchmark::DoNotOptimize(r);
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_dynamic_cast_2(benchmark::State &state) {
|
||||
base4 b4;
|
||||
for ( auto _ : state ) {
|
||||
base4* r = rttr::rttr_cast<base4*>(static_cast<base2*>(&b4));
|
||||
benchmark::DoNotOptimize(r);
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_dynamic_cast_3(benchmark::State &state) {
|
||||
base4 b4;
|
||||
for ( auto _ : state ) {
|
||||
base4* r = rttr::rttr_cast<base4*>(static_cast<base3*>(&b4));
|
||||
benchmark::DoNotOptimize(r);
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_dynamic_cast_4(benchmark::State &state) {
|
||||
base4 b4;
|
||||
for ( auto _ : state ) {
|
||||
base4* r = rttr::rttr_cast<base4*>(static_cast<base4*>(&b4));
|
||||
benchmark::DoNotOptimize(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(dynamic_cast_1);
|
||||
BENCHMARK(meta_dynamic_cast_1);
|
||||
BENCHMARK(rttr_dynamic_cast_1);
|
||||
|
||||
BENCHMARK(dynamic_cast_2);
|
||||
BENCHMARK(meta_dynamic_cast_2);
|
||||
BENCHMARK(rttr_dynamic_cast_2);
|
||||
|
||||
BENCHMARK(dynamic_cast_3);
|
||||
BENCHMARK(meta_dynamic_cast_3);
|
||||
BENCHMARK(rttr_dynamic_cast_3);
|
||||
|
||||
BENCHMARK(dynamic_cast_4);
|
||||
BENCHMARK(meta_dynamic_cast_4);
|
||||
BENCHMARK(rttr_dynamic_cast_4);
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
#include <meta.hpp/meta_all.hpp>
|
||||
#include <vmath.hpp/vmath_all.hpp>
|
||||
|
||||
#include <rttr/type>
|
||||
#include <rttr/registration>
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
namespace
|
||||
@@ -59,17 +56,6 @@ namespace
|
||||
.function_("invoke_function_4", &static_function_4);
|
||||
}
|
||||
|
||||
RTTR_REGISTRATION
|
||||
{
|
||||
using namespace rttr;
|
||||
|
||||
registration::method("invoke_function_0", &static_function_0);
|
||||
registration::method("invoke_function_1", &static_function_1);
|
||||
registration::method("invoke_function_2", &static_function_2);
|
||||
registration::method("invoke_function_3", &static_function_3);
|
||||
registration::method("invoke_function_4", &static_function_4);
|
||||
}
|
||||
|
||||
//
|
||||
// native
|
||||
//
|
||||
@@ -167,79 +153,17 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// rttr
|
||||
//
|
||||
|
||||
namespace
|
||||
{
|
||||
[[maybe_unused]]
|
||||
void rttr_invoke_function_0(benchmark::State &state) {
|
||||
rttr::method m = rttr::type::get_global_method("invoke_function_0");
|
||||
META_HPP_ASSERT(m.is_valid());
|
||||
|
||||
for ( auto _ : state ) {
|
||||
m.invoke({});
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_invoke_function_1(benchmark::State &state) {
|
||||
rttr::method m = rttr::type::get_global_method("invoke_function_1");
|
||||
META_HPP_ASSERT(m.is_valid());
|
||||
|
||||
for ( auto _ : state ) {
|
||||
m.invoke({}, static_angle);
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_invoke_function_2(benchmark::State &state) {
|
||||
rttr::method m = rttr::type::get_global_method("invoke_function_2");
|
||||
META_HPP_ASSERT(m.is_valid());
|
||||
|
||||
for ( auto _ : state ) {
|
||||
m.invoke({}, static_angle, vmath::unit3_x<float>);
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_invoke_function_3(benchmark::State &state) {
|
||||
rttr::method m = rttr::type::get_global_method("invoke_function_3");
|
||||
META_HPP_ASSERT(m.is_valid());
|
||||
|
||||
for ( auto _ : state ) {
|
||||
m.invoke({}, static_angle, vmath::unit3_x<float>, 2.f);
|
||||
}
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
void rttr_invoke_function_4(benchmark::State &state) {
|
||||
rttr::method m = rttr::type::get_global_method("invoke_function_4");
|
||||
META_HPP_ASSERT(m.is_valid());
|
||||
|
||||
for ( auto _ : state ) {
|
||||
m.invoke({}, static_angle, vmath::unit3_x<float>, 2.f, vmath::midentity3<float>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(invoke_function_0)->Teardown(static_function_reset);
|
||||
BENCHMARK(meta_invoke_function_0)->Teardown(static_function_reset);
|
||||
BENCHMARK(rttr_invoke_function_0)->Teardown(static_function_reset);
|
||||
|
||||
BENCHMARK(invoke_function_1)->Teardown(static_function_reset);
|
||||
BENCHMARK(meta_invoke_function_1)->Teardown(static_function_reset);
|
||||
BENCHMARK(rttr_invoke_function_1)->Teardown(static_function_reset);
|
||||
|
||||
BENCHMARK(invoke_function_2)->Teardown(static_function_reset);
|
||||
BENCHMARK(meta_invoke_function_2)->Teardown(static_function_reset);
|
||||
BENCHMARK(rttr_invoke_function_2)->Teardown(static_function_reset);
|
||||
|
||||
BENCHMARK(invoke_function_3)->Teardown(static_function_reset);
|
||||
BENCHMARK(meta_invoke_function_3)->Teardown(static_function_reset);
|
||||
BENCHMARK(rttr_invoke_function_3)->Teardown(static_function_reset);
|
||||
|
||||
BENCHMARK(invoke_function_4)->Teardown(static_function_reset);
|
||||
BENCHMARK(meta_invoke_function_4)->Teardown(static_function_reset);
|
||||
BENCHMARK(rttr_invoke_function_4)->Teardown(static_function_reset);
|
||||
|
||||
22
develop/vendors/CMakeLists.txt
vendored
22
develop/vendors/CMakeLists.txt
vendored
@@ -54,28 +54,6 @@ target_include_directories(${PROJECT_NAME}.gbench SYSTEM
|
||||
target_compile_definitions(${PROJECT_NAME}.gbench
|
||||
PUBLIC BENCHMARK_STATIC_DEFINE)
|
||||
|
||||
#
|
||||
# rttr
|
||||
#
|
||||
|
||||
file(GLOB_RECURSE RTTR_SOURCES CONFIGURE_DEPENDS "rttr/src/rttr/*.cpp")
|
||||
add_library(${PROJECT_NAME}.rttr STATIC EXCLUDE_FROM_ALL ${RTTR_SOURCES})
|
||||
add_library(${PROJECT_NAME}::rttr ALIAS ${PROJECT_NAME}.rttr)
|
||||
|
||||
target_compile_features(${PROJECT_NAME}.rttr
|
||||
PUBLIC cxx_std_20)
|
||||
|
||||
target_include_directories(${PROJECT_NAME}.rttr SYSTEM
|
||||
PUBLIC rttr/src)
|
||||
|
||||
configure_file(
|
||||
"rttr/src/rttr/detail/base/version.h.in"
|
||||
"generated/vendors/rttr/rttr/detail/base/version.h"
|
||||
@ONLY)
|
||||
|
||||
target_include_directories(${PROJECT_NAME}.rttr SYSTEM
|
||||
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/generated/vendors/rttr")
|
||||
|
||||
#
|
||||
# vmath.hpp
|
||||
#
|
||||
|
||||
1
develop/vendors/rttr
vendored
1
develop/vendors/rttr
vendored
Submodule develop/vendors/rttr deleted from 7edbd580cf
Reference in New Issue
Block a user