diff --git a/.gitmodules b/.gitmodules index b102aa3..6feceff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/develop/unbench/CMakeLists.txt b/develop/unbench/CMakeLists.txt index f226654..9111d6c 100644 --- a/develop/unbench/CMakeLists.txt +++ b/develop/unbench/CMakeLists.txt @@ -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 diff --git a/develop/unbench/cast_function_bench.cpp b/develop/unbench/cast_function_bench.cpp index 6dc0d8d..4c797e4 100644 --- a/develop/unbench/cast_function_bench.cpp +++ b/develop/unbench/cast_function_bench.cpp @@ -7,9 +7,6 @@ #include #include -#include -#include - #include 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(&b4)).get_value(); - 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(&b4), - rttr::rttr_cast(&b4)).get_value(); - 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(&b4), - rttr::rttr_cast(&b4), - rttr::rttr_cast(&b4)).get_value(); - 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(&b4), - rttr::rttr_cast(&b4), - rttr::rttr_cast(&b4), - rttr::rttr_cast(&b4)).get_value(); - 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); diff --git a/develop/unbench/dynamic_cast_bench.cpp b/develop/unbench/dynamic_cast_bench.cpp index 9c5d681..9d6e4a4 100644 --- a/develop/unbench/dynamic_cast_bench.cpp +++ b/develop/unbench/dynamic_cast_bench.cpp @@ -7,9 +7,6 @@ #include #include -#include -#include - #include 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(static_cast(&b4)); - benchmark::DoNotOptimize(r); - } - } - - [[maybe_unused]] - void rttr_dynamic_cast_2(benchmark::State &state) { - base4 b4; - for ( auto _ : state ) { - base4* r = rttr::rttr_cast(static_cast(&b4)); - benchmark::DoNotOptimize(r); - } - } - - [[maybe_unused]] - void rttr_dynamic_cast_3(benchmark::State &state) { - base4 b4; - for ( auto _ : state ) { - base4* r = rttr::rttr_cast(static_cast(&b4)); - benchmark::DoNotOptimize(r); - } - } - - [[maybe_unused]] - void rttr_dynamic_cast_4(benchmark::State &state) { - base4 b4; - for ( auto _ : state ) { - base4* r = rttr::rttr_cast(static_cast(&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); diff --git a/develop/unbench/invoke_function_bench.cpp b/develop/unbench/invoke_function_bench.cpp index 2f13f0c..0355db2 100644 --- a/develop/unbench/invoke_function_bench.cpp +++ b/develop/unbench/invoke_function_bench.cpp @@ -7,9 +7,6 @@ #include #include -#include -#include - #include 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); - } - } - - [[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, 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, 2.f, vmath::midentity3); - } - } -} - 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); diff --git a/develop/vendors/CMakeLists.txt b/develop/vendors/CMakeLists.txt index 67e4912..8167d76 100644 --- a/develop/vendors/CMakeLists.txt +++ b/develop/vendors/CMakeLists.txt @@ -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 # diff --git a/develop/vendors/rttr b/develop/vendors/rttr deleted file mode 160000 index 7edbd58..0000000 --- a/develop/vendors/rttr +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7edbd580cfad509a3253c733e70144e36f02ecd4