From 3ee7a2884345c9cd5cb45564a32af17b67db56ba Mon Sep 17 00:00:00 2001 From: neeraj31285 Date: Wed, 10 Sep 2025 04:09:11 +0530 Subject: [PATCH 1/6] Cloning code-path flow changed, major refactor. --- ...ogs-linux.md => rtl-bm-raw-logs-linux.txt} | 0 .../CxxTestProxyDesignPattern/inc/Proxy.hpp | 4 +- RTLBenchmarkApp/src/BenchMark.cpp | 13 +-- RTLBenchmarkApp/src/BenchMark.h | 2 +- .../NameSpaceGlobalsTests.cpp | 2 + .../ReflectionOpErrorCodeTests.cpp | 27 +++++- .../ReturnValueReflectionTest.cpp | 22 +++-- .../RObjectReflecting_stdSharedPtr.cpp | 34 +++++++ ReflectionTemplateLib/access/inc/CxxMirror.h | 5 +- ReflectionTemplateLib/access/inc/Function.h | 4 +- ReflectionTemplateLib/access/inc/Method.h | 2 +- ReflectionTemplateLib/access/inc/Method.hpp | 6 +- ReflectionTemplateLib/access/inc/RObject.h | 17 ++-- ReflectionTemplateLib/access/inc/RObject.hpp | 42 ++++++-- ReflectionTemplateLib/access/inc/Record.h | 50 +++++----- .../access/src/CxxMirror.cpp | 26 ++++- ReflectionTemplateLib/common/Constants.h | 6 ++ ReflectionTemplateLib/common/error_codes.h | 8 +- ReflectionTemplateLib/common/rtl_traits.h | 11 +++ .../detail/inc/CallReflector.h | 78 ++++++++------- ReflectionTemplateLib/detail/inc/FunctorId.h | 53 ++++------ .../detail/inc/RObjExtracter.h | 20 ++-- .../detail/inc/RObjectBuilder.h | 12 +-- .../detail/inc/RObjectBuilder.hpp | 66 ++----------- ReflectionTemplateLib/detail/inc/RObjectId.h | 5 +- .../detail/inc/ReflectionBuilder.hpp | 10 +- .../detail/inc/SetupConstructor.h | 10 +- .../detail/inc/SetupConstructor.hpp | 96 +++++++++++++++++-- .../detail/inc/SetupFunction.hpp | 11 ++- .../detail/inc/SetupMethod.hpp | 32 ++++--- .../detail/src/CMakeLists.txt | 1 - .../detail/src/FunctorId.cpp | 36 ------- 32 files changed, 422 insertions(+), 289 deletions(-) rename BenchMarkReports/{rtl-bm-raw-logs-linux.md => rtl-bm-raw-logs-linux.txt} (100%) delete mode 100644 ReflectionTemplateLib/detail/src/FunctorId.cpp diff --git a/BenchMarkReports/rtl-bm-raw-logs-linux.md b/BenchMarkReports/rtl-bm-raw-logs-linux.txt similarity index 100% rename from BenchMarkReports/rtl-bm-raw-logs-linux.md rename to BenchMarkReports/rtl-bm-raw-logs-linux.txt diff --git a/CxxTestDesignPatternsUsingRTL/CxxTestProxyDesignPattern/inc/Proxy.hpp b/CxxTestDesignPatternsUsingRTL/CxxTestProxyDesignPattern/inc/Proxy.hpp index 946b4c37..3744d103 100644 --- a/CxxTestDesignPatternsUsingRTL/CxxTestProxyDesignPattern/inc/Proxy.hpp +++ b/CxxTestDesignPatternsUsingRTL/CxxTestProxyDesignPattern/inc/Proxy.hpp @@ -19,7 +19,7 @@ namespace proxy_test { const auto orgMethod = OriginalReflection::getClass()->getMethod(pFunctionName); if (!orgMethod.has_value()) { - return { rtl::error::FunctionNotRegisterd, rtl::RObject{ } }; + return { rtl::error::FunctionNotRegistered, rtl::RObject{ } }; } if (orgMethod->hasSignature<_args...>()) { return orgMethod->bind(m_originalObj).call(std::forward<_args>(params)...); @@ -44,7 +44,7 @@ namespace proxy_test { const auto orgMethod = OriginalReflection::getClass()->getMethod(pFunctionName); if (!orgMethod.has_value()) { - return { rtl::error::FunctionNotRegisterd, rtl::RObject{ } }; + return { rtl::error::FunctionNotRegistered, rtl::RObject{ } }; } if (orgMethod->hasSignature<_args...>()) { return orgMethod->bind().call(std::forward<_args>(params)...); diff --git a/RTLBenchmarkApp/src/BenchMark.cpp b/RTLBenchmarkApp/src/BenchMark.cpp index 97afd4dd..7ba11f9d 100644 --- a/RTLBenchmarkApp/src/BenchMark.cpp +++ b/RTLBenchmarkApp/src/BenchMark.cpp @@ -8,12 +8,13 @@ namespace { - static const char* LONG_STR = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do" - "do aeiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis" - "nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure" - "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Except" - "eur ssint occaecat cupidatat nnon proident, sunt in culpa qui officia deserunt mollit anim id" - "Lorem ipsum dolor sit amet laboris nisi ut aliquip ex ea commodo"; + static const char* LONG_STR = "Lorem ipsum"; + // dolor sit amet, consectetur adipiscing elit, sed do" + //"do aeiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis" + //"nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure" + //"dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Except" + //"eur ssint occaecat cupidatat nnon proident, sunt in culpa qui officia deserunt mollit anim id" + //"Lorem ipsum dolor sit amet laboris nisi ut aliquip ex ea commodo"; } // Pre-created string to isolate call overhead diff --git a/RTLBenchmarkApp/src/BenchMark.h b/RTLBenchmarkApp/src/BenchMark.h index 2959aef8..3192d31f 100644 --- a/RTLBenchmarkApp/src/BenchMark.h +++ b/RTLBenchmarkApp/src/BenchMark.h @@ -15,7 +15,7 @@ using argStr_t = std::string_view; using retStr_t = std::string_view; -#define WORK_LOAD(S) (std::string(S) + std::string(S)) +#define WORK_LOAD(S) (std::string(S)) namespace rtl_bench diff --git a/RTLTestRunApp/src/FunctionalityTests/NameSpaceGlobalsTests.cpp b/RTLTestRunApp/src/FunctionalityTests/NameSpaceGlobalsTests.cpp index 37ae2c05..e6ff2411 100644 --- a/RTLTestRunApp/src/FunctionalityTests/NameSpaceGlobalsTests.cpp +++ b/RTLTestRunApp/src/FunctionalityTests/NameSpaceGlobalsTests.cpp @@ -59,6 +59,8 @@ namespace rtl_tests { //Now for cases, if you want to handle it type-erased and pass around. RObject reflChar = rtl::reflect('Q'); + error reterr = cxx::mirror().enableCloning(reflChar); + ASSERT_TRUE(reterr == error::None); { //Internally calls the copy constructor. auto [err, rchar] = reflChar.clone(); diff --git a/RTLTestRunApp/src/FunctionalityTests/ReflectionOpErrorCodeTests.cpp b/RTLTestRunApp/src/FunctionalityTests/ReflectionOpErrorCodeTests.cpp index 222f9d42..0f6ed8c6 100644 --- a/RTLTestRunApp/src/FunctionalityTests/ReflectionOpErrorCodeTests.cpp +++ b/RTLTestRunApp/src/FunctionalityTests/ReflectionOpErrorCodeTests.cpp @@ -8,7 +8,7 @@ * rtl::error::NonConstOverloadMissing * rtl::error::ConstCallViolation * and, -* rtl::error::FunctionNotRegisterd, is not internally used by RTL. +* rtl::error::FunctionNotRegistered, is not internally used by RTL. * Function/Method objects are returned wrapped in std::optional<>, which will * be empty if its not in registered in Reflection-system. * @@ -69,6 +69,10 @@ namespace rtl_tests { char ch = 'R'; RObject rCh = rtl::reflect(ch); + + error reterr = cxx::mirror().enableCloning(rCh); + ASSERT_TRUE(reterr == error::None); + EXPECT_FALSE(rCh.isAllocatedByRtl()); { auto [err, rch] = rCh.clone(); @@ -105,10 +109,14 @@ namespace rtl_tests { RObject rChptr = rtl::reflect(chPtr); - + ASSERT_FALSE(rChptr.isEmpty()); EXPECT_FALSE(rChptr.isAllocatedByRtl()); ASSERT_TRUE(rtl::getRtlManagedHeapInstanceCount() == 1); + + error reterr = cxx::mirror().enableCloning(rChptr); + ASSERT_TRUE(reterr == error::None); + EXPECT_TRUE(rChptr.canViewAs()); { auto viewCh = rChptr.view(); @@ -187,11 +195,20 @@ namespace rtl_tests ASSERT_FALSE(event.isEmpty()); // Try to call copy-constructor of class Event. - auto [err2, eventCp] = event.clone(); + auto [err2, eventCp0] = event.clone(); + + EXPECT_TRUE(err2 == error::CloningDisabled); + ASSERT_TRUE(eventCp0.isEmpty()); + + error reterr = cxx::mirror().enableCloning(event); + ASSERT_TRUE(reterr == error::None); + + // Try to call copy-constructor of class Event. + auto [err3, eventCp1] = event.clone(); // Cannot create heap instance: Calender's copy constructor is deleted. - EXPECT_TRUE(err2 == error::TypeNotCopyConstructible); - ASSERT_TRUE(eventCp.isEmpty()); + EXPECT_TRUE(err3 == error::TypeNotCopyConstructible); + ASSERT_TRUE(eventCp1.isEmpty()); } EXPECT_TRUE(calender::assert_zero_instance_count()); ASSERT_TRUE(rtl::getRtlManagedHeapInstanceCount() == 0); diff --git a/RTLTestRunApp/src/FunctionalityTests/ReturnValueReflectionTest.cpp b/RTLTestRunApp/src/FunctionalityTests/ReturnValueReflectionTest.cpp index 939d1b9c..80b87ff5 100644 --- a/RTLTestRunApp/src/FunctionalityTests/ReturnValueReflectionTest.cpp +++ b/RTLTestRunApp/src/FunctionalityTests/ReturnValueReflectionTest.cpp @@ -46,12 +46,22 @@ namespace rtl_tests ASSERT_FALSE(event.isEmpty()); EXPECT_TRUE(event.getTypeId() == reflected_id::event); { - auto [err, robj] = event.clone(); - //Event's copy-constructor private or deleted. - EXPECT_TRUE(err == rtl::error::TypeNotCopyConstructible); - ASSERT_TRUE(robj.isEmpty()); - // Two 'Event' instances, owned by 'Calender' - EXPECT_TRUE(event::get_instance_count() == 2); + { + auto [err, robj] = event.clone(); + EXPECT_TRUE(err == rtl::error::CloningDisabled); + } + + rtl::error reterr = cxx::mirror().enableCloning(event); + ASSERT_TRUE(reterr == rtl::error::None); + + { + auto [err, robj] = event.clone(); + //Event's copy-constructor private or deleted. + EXPECT_TRUE(err == rtl::error::TypeNotCopyConstructible); + ASSERT_TRUE(robj.isEmpty()); + // Two 'Event' instances, owned by 'Calender' + EXPECT_TRUE(event::get_instance_count() == 2); + } } { auto [err, robj] = event.clone(); //Event's copy-constructor private or deleted. diff --git a/RTLTestRunApp/src/RObjectTests/RObjectReflecting_stdSharedPtr.cpp b/RTLTestRunApp/src/RObjectTests/RObjectReflecting_stdSharedPtr.cpp index 30970909..f395856c 100644 --- a/RTLTestRunApp/src/RObjectTests/RObjectReflecting_stdSharedPtr.cpp +++ b/RTLTestRunApp/src/RObjectTests/RObjectReflecting_stdSharedPtr.cpp @@ -8,6 +8,23 @@ using namespace test_utils; using namespace rtl; +namespace { + + // Cloning is only available for types explicitly registered by the user. + // This is because cloning requires a lambda to be stored in a static table. + // Types reflected via rtl::reflect or obtained as the return value of a reflective call + // cannot be cloned unless they are explicitly registered. + + static rtl::CxxMirror cxx_mirror() + { + static rtl::CxxMirror m = rtl::CxxMirror({ + rtl::type().record("int").build(), + rtl::type().record("Node").build() + }); + return m; + } +} + namespace rtl::unit_test { TEST(RObject_reflecting_shared_ptr, sharing_semantics__pod) @@ -101,6 +118,10 @@ namespace rtl::unit_test { constexpr const int NUM = -20438; RObject robj = reflect(std::make_shared(NUM)); + + error reterr = cxx_mirror().enableCloning(robj); + ASSERT_TRUE(reterr == error::None); + ASSERT_FALSE(robj.isEmpty()); // --- Step 1: Clone by default (entity::Auto semantics) --- @@ -193,6 +214,9 @@ namespace rtl::unit_test RObject robj = reflect(std::make_shared(NUM)); ASSERT_FALSE(robj.isEmpty()); + error reterr = cxx_mirror().enableCloning(robj); + ASSERT_TRUE(reterr == error::None); + // --- Step 1: Clone by default (entity::Auto semantics) --- { // Default cloning shallow-copies the wrapper. @@ -247,6 +271,9 @@ namespace rtl::unit_test ASSERT_FALSE(robj.isEmpty()); ASSERT_TRUE(Node::instanceCount() == 1); + error reterr = cxx_mirror().enableCloning(robj); + ASSERT_TRUE(reterr == error::None); + // --- Step 2: Clone by default (entity::Auto semantics) --- { // Default cloning shallow-copies the wrapper. @@ -326,6 +353,10 @@ namespace rtl::unit_test { constexpr const int NUM = 241054; RObject robj = reflect(std::make_shared(NUM)); + + error reterr = cxx_mirror().enableCloning(robj); + ASSERT_TRUE(reterr == error::None); + ASSERT_FALSE(robj.isEmpty()); ASSERT_TRUE(Node::instanceCount() == 1); @@ -568,6 +599,9 @@ namespace rtl::unit_test constexpr const int NUM = 10742; RObject robj = reflect(std::make_shared(NUM)); + error reterr = cxx_mirror().enableCloning(robj); + ASSERT_TRUE(reterr == error::None); + ASSERT_FALSE(robj.isEmpty()); EXPECT_TRUE(robj.canViewAs>()); diff --git a/ReflectionTemplateLib/access/inc/CxxMirror.h b/ReflectionTemplateLib/access/inc/CxxMirror.h index 065fe782..63c3e180 100644 --- a/ReflectionTemplateLib/access/inc/CxxMirror.h +++ b/ReflectionTemplateLib/access/inc/CxxMirror.h @@ -17,8 +17,9 @@ namespace rtl { // Forward declarations class Record; + class RObject; class Function; - + /* @class CxxMirror * Provides the primary interface to access registered functions and methods by name. * This is the single point of access to the entire reflection system. @@ -49,6 +50,8 @@ namespace rtl // Constructs CxxMirror using a set of Function objects. All other constructors are disabled. explicit CxxMirror(const std::vector& pFunctions); + error enableCloning(const RObject& pTarget) const; + // Returns a Record containing function hash-keys for the given record ID. std::optional getRecord(const std::size_t pRecordId) const; diff --git a/ReflectionTemplateLib/access/inc/Function.h b/ReflectionTemplateLib/access/inc/Function.h index 94675923..bdb64eab 100644 --- a/ReflectionTemplateLib/access/inc/Function.h +++ b/ReflectionTemplateLib/access/inc/Function.h @@ -60,8 +60,6 @@ namespace rtl { void addOverload(const Function& pOtherFunc) const; - GETTER_REF(std::vector, FunctorIds, m_functorIds) - protected: Function(const Function& pOther, const detail::FunctorId& pFunctorId, @@ -71,6 +69,8 @@ namespace rtl { GETTER(detail::methodQ, Qualifier, m_qualifier); + GETTER_REF(std::vector, FunctorIds, m_functorIds) + public: //simple inlined getters. diff --git a/ReflectionTemplateLib/access/inc/Method.h b/ReflectionTemplateLib/access/inc/Method.h index d6ec6045..000df1da 100644 --- a/ReflectionTemplateLib/access/inc/Method.h +++ b/ReflectionTemplateLib/access/inc/Method.h @@ -43,7 +43,7 @@ namespace rtl { //invokes the constructor associated with this 'Method' template - Return invokeCtor(alloc&& pAllocType, _args&&...params) const; + Return invokeCtor(alloc&& pAllocType, std::size_t&& pClonerIndex, _args&&...params) const; public: diff --git a/ReflectionTemplateLib/access/inc/Method.hpp b/ReflectionTemplateLib/access/inc/Method.hpp index cc08864b..585ae934 100644 --- a/ReflectionTemplateLib/access/inc/Method.hpp +++ b/ReflectionTemplateLib/access/inc/Method.hpp @@ -34,9 +34,11 @@ namespace rtl @return: RStatus * calls the constructor with given arguments. */ template - inline Return Method::invokeCtor(alloc&& pAllocType, _args&& ...params) const + inline Return Method::invokeCtor(alloc&& pAllocType, std::size_t&& pClonerIndex, _args&& ...params) const { - return Function::bind().call(std::forward(pAllocType), std::forward<_args>(params)...); + return Function::bind().call( std::forward(pAllocType), + std::forward(pClonerIndex), + std::forward<_args>(params)...); } diff --git a/ReflectionTemplateLib/access/inc/RObject.h b/ReflectionTemplateLib/access/inc/RObject.h index 208e2c59..9685be6f 100644 --- a/ReflectionTemplateLib/access/inc/RObject.h +++ b/ReflectionTemplateLib/access/inc/RObject.h @@ -37,20 +37,17 @@ namespace rtl { struct Return; class Function; + class CxxMirror; //Reflecting the object within. class RObject { - using Cloner = std::function< Return(const RObject&, rtl::alloc) >; - - std::any m_object; - detail::RObjectId m_objectId; - - const Cloner* m_getClone = nullptr; + std::optional m_object = std::nullopt; + detail::RObjectId m_objectId = {}; const std::vector* m_converters = nullptr; RObject(const RObject&) = default; - RObject(std::any&& pObject, const detail::RObjectId pRObjId, const Cloner* pCloner, + RObject(std::any&& pObject, detail::RObjectId&& pRObjId, const std::vector* pConverters) noexcept; std::size_t getConverterIndex(const std::size_t pToTypeId) const; @@ -69,7 +66,7 @@ namespace rtl RObject& operator=(RObject&&) = delete; RObject& operator=(const RObject&) = delete; - GETTER_BOOL(Empty, (m_object.has_value() == false)) + GETTER_BOOL(Empty, (m_object == std::nullopt)) GETTER_BOOL(OnHeap, (m_objectId.m_allocatedOn == alloc::Heap)) GETTER_BOOL(AllocatedByRtl, (m_objectId.m_allocatedOn == alloc::Heap)) GETTER(std::size_t, TypeId, m_objectId.m_typeId) @@ -98,9 +95,11 @@ namespace rtl static std::atomic& getInstanceCounter(); //friends :) + friend CxxMirror; + friend detail::RObjExtractor; + template friend struct detail::RObjectUPtr; - friend detail::RObjExtractor; template friend struct detail::RObjectBuilder; diff --git a/ReflectionTemplateLib/access/inc/RObject.hpp b/ReflectionTemplateLib/access/inc/RObject.hpp index f55d6dda..7c4e7d4e 100644 --- a/ReflectionTemplateLib/access/inc/RObject.hpp +++ b/ReflectionTemplateLib/access/inc/RObject.hpp @@ -21,27 +21,25 @@ #include "ReflectCast.h" #include "RObjExtracter.h" #include "RObjectBuilder.h" +#include "FunctorContainer.h" namespace rtl { - FORCE_INLINE RObject::RObject(std::any&& pObject, const detail::RObjectId pRObjId, const Cloner* pCloner, + FORCE_INLINE RObject::RObject(std::any&& pObject, detail::RObjectId&& pRObjId, const std::vector* pConverters) noexcept - : m_object(std::move(pObject)) + : m_object(std::in_place, std::move(pObject)) , m_objectId(pRObjId) - , m_getClone(pCloner) , m_converters(pConverters) { } inline RObject::RObject(RObject&& pOther) noexcept : m_object(std::move(pOther.m_object)) , m_objectId(pOther.m_objectId) - , m_getClone(pOther.m_getClone) , m_converters(pOther.m_converters) { // Explicitly clear moved-from source - pOther.m_object.reset(); + pOther.m_object = std::nullopt; pOther.m_objectId = {}; - pOther.m_getClone = nullptr; pOther.m_converters = nullptr; } @@ -68,6 +66,10 @@ namespace rtl template inline bool RObject::canViewAs() const { + if (isEmpty()) { + return false; + } + if constexpr (traits::is_bare_type()) { if constexpr (traits::std_wrapper::type != detail::Wrapper::None) { if (m_objectId.m_wrapperTypeId == traits::std_wrapper::id()) { @@ -85,7 +87,7 @@ namespace rtl { detail::EntityKind newKind = detail::EntityKind::None; const traits::Converter& convert = (*m_converters)[pIndex].second; - const std::any& viewObj = convert(m_object, m_objectId.m_containsAs, newKind); + const std::any& viewObj = convert(m_object.value(), m_objectId.m_containsAs, newKind); const T* viewRef = detail::RObjExtractor::getPointer(viewObj, newKind); if (viewRef != nullptr && newKind == detail::EntityKind::Ref) { @@ -103,6 +105,10 @@ namespace rtl template , int>> FORCE_INLINE std::optional> RObject::view() const { + if (isEmpty()) { + return std::nullopt; + } + if constexpr (traits::is_bare_type()) { if (detail::TypeId::get() == m_objectId.m_wrapperTypeId) @@ -119,6 +125,10 @@ namespace rtl template , int>> FORCE_INLINE std::optional> RObject::view() const { + if (isEmpty()) { + return std::nullopt; + } + if constexpr (traits::is_bare_type()) { if (detail::TypeId::get() == m_objectId.m_wrapperTypeId) @@ -136,6 +146,10 @@ namespace rtl template , int>> FORCE_INLINE std::optional> RObject::view() const { + if (isEmpty()) { + return std::nullopt; + } + if constexpr (traits::is_bare_type()) { const std::size_t asTypeId = detail::TypeId::get(); @@ -165,14 +179,24 @@ namespace rtl template<> inline Return RObject::createCopy() const { - return (*m_getClone)(*this, alloc::Heap); + std::size_t pClonerIndex = m_objectId.m_clonerIndex; + if (pClonerIndex != rtl::index_none) + { + return traits::Cloner::template forwardCall(pClonerIndex, alloc::Heap, pClonerIndex, *this); + } + return { error::CloningDisabled, RObject() }; } template<> inline Return RObject::createCopy() const { - return (*m_getClone)(*this, alloc::Stack); + std::size_t pClonerIndex = m_objectId.m_clonerIndex; + if (pClonerIndex != rtl::index_none) + { + return traits::Cloner::template forwardCall(pClonerIndex, alloc::Stack, pClonerIndex, *this); + } + return { error::CloningDisabled, RObject() }; } diff --git a/ReflectionTemplateLib/access/inc/Record.h b/ReflectionTemplateLib/access/inc/Record.h index 4956f29f..8baa152c 100644 --- a/ReflectionTemplateLib/access/inc/Record.h +++ b/ReflectionTemplateLib/access/inc/Record.h @@ -30,12 +30,12 @@ namespace rtl { class Method; class RObject; - /* @class: Record - * represents a reflected class/struct. - * contains registered member-functions as 'Method' objects. - * provides interface to access methods by name. - * provides interface to construct instances of the class/struct using the registered constructors. - */ class Record +/* @class: Record + * represents a reflected class/struct. + * contains registered member-functions as 'Method' objects. + * provides interface to access methods by name. + * provides interface to construct instances of the class/struct using the registered constructors. +*/ class Record { using MethodMap = std::unordered_map< std::string, Method >; @@ -64,12 +64,12 @@ namespace rtl { Record& operator=(const Record&) = default; GETTER_CREF(MethodMap, MethodMap, m_methods) - - /* @method: getMethod - @param: const std::string& (name of the method) - @return: std::optional - * if the method isn't found by the given name, std::nullopt is returned. - */ std::optional getMethod(const std::string& pMethod) const + GETTER_CREF(std::string, RecordName, m_recordName) +/* @method: getMethod + @param: const std::string& (name of the method) + @return: std::optional + * if the method isn't found by the given name, std::nullopt is returned. +*/ std::optional getMethod(const std::string& pMethod) const { const auto& itr = m_methods.find(pMethod); if (itr != m_methods.end()) { @@ -79,20 +79,24 @@ namespace rtl { } - /* @method: create - @param: ...params (any number/type of arguments) - @return: Return - * calls the constructor of the calss/struct represented by this 'Record' object. - * returns the dynamically allocated object of the calss/struct along with the status. - * only default or any other overloaded constructor is called, except copy (for that check, Record::clone()). - * if the signature(...params) did not match any registered ctor, error::SignatureMismatch is returned with empty 'RObject'. - * if no constructor found, error::ConstructorNotRegisteredInRtl is returned with empty 'RObject'. - * on success error::None and newly constructed object wrapped under 'RObject' (type erased, treated as non-const) is returned. - */ template +/* @method: create + @param: ...params (any number/type of arguments) + @return: Return + * calls the constructor of the calss/struct represented by this 'Record' object. + * returns the dynamically allocated object of the calss/struct along with the status. + * only default or any other overloaded constructor is called, except copy (for that check, Record::clone()). + * if the signature(...params) did not match any registered ctor, error::SignatureMismatch is returned with empty 'RObject'. + * if no constructor found, error::ConstructorNotRegisteredInRtl is returned with empty 'RObject'. + * on success error::None and newly constructed object wrapped under 'RObject' (type erased, treated as non-const) is returned. +*/ template Return create(_ctorArgs&& ...params) const { static_assert(_alloc != rtl::alloc::None, "Instance cannot be created with 'rtl::alloc::None' option."); - return m_methods.at(detail::ctor_name(m_recordName)).invokeCtor(_alloc, std::forward<_ctorArgs>(params)...); + const auto& method = m_methods.at(detail::ctor_name(m_recordName)); + std::size_t copyCtorIndex = method.getFunctorIds().at(detail::Index::CopyCtor).getIndex(); + return method.invokeCtor( _alloc, + std::move(copyCtorIndex), + std::forward<_ctorArgs>(params)...); } //only class which can create objects of this class & manipulates 'm_methods'. diff --git a/ReflectionTemplateLib/access/src/CxxMirror.cpp b/ReflectionTemplateLib/access/src/CxxMirror.cpp index c46ce90e..af976e0e 100644 --- a/ReflectionTemplateLib/access/src/CxxMirror.cpp +++ b/ReflectionTemplateLib/access/src/CxxMirror.cpp @@ -13,12 +13,28 @@ #include "CxxMirror.h" #include "ReflectCast.h" -namespace rtl::detail +namespace rtl { - std::size_t generate_unique_id() + namespace detail { - // Starts with ONE, ZERO denotes TypeId<>::None. [Never change, critical.] - static std::atomic counter{ TypeId<>::None + 1 }; - return counter.fetch_add(1, std::memory_order_relaxed); + std::size_t generate_unique_id() + { + // Starts with ONE, ZERO denotes TypeId<>::None. [Never change, critical.] + static std::atomic counter{ TypeId<>::None + 1 }; + return counter.fetch_add(1, std::memory_order_relaxed); + } + } + + error CxxMirror::enableCloning(const RObject& pTarget) const + { + const auto& itr = getRecordIdMap().find(pTarget.getTypeId()); + if (itr != getRecordIdMap().end()) + { + const Record& record = itr->second; + Method ctors = record.getMethod(detail::ctor_name(record.getRecordName())).value(); + const_cast(pTarget).m_objectId.m_clonerIndex = ctors.getFunctors().at(detail::Index::CopyCtor).getIndex(); + return error::None; + } + return error::CloningDisabled; } } \ No newline at end of file diff --git a/ReflectionTemplateLib/common/Constants.h b/ReflectionTemplateLib/common/Constants.h index 145cd01c..b70ddabe 100644 --- a/ReflectionTemplateLib/common/Constants.h +++ b/ReflectionTemplateLib/common/Constants.h @@ -122,6 +122,12 @@ namespace rtl::detail Reference }; + enum Index + { + Ctor = 0, + CopyCtor + }; + // MethodQ: Method qualifier + static marker. enum class methodQ diff --git a/ReflectionTemplateLib/common/error_codes.h b/ReflectionTemplateLib/common/error_codes.h index 12195fd4..4dc5e28c 100644 --- a/ReflectionTemplateLib/common/error_codes.h +++ b/ReflectionTemplateLib/common/error_codes.h @@ -23,7 +23,8 @@ namespace rtl TargetMismatch, SignatureMismatch, - FunctionNotRegisterd, //Not used by RTL at all, for external purpose only. + CloningDisabled, //Used only in case of cloning is disabled e.g, unregistered type. + FunctionNotRegistered, //Not used by RTL at all, for external purpose only. IllegalConstCast, ConstOverloadMissing, @@ -31,6 +32,7 @@ namespace rtl TypeNotCopyConstructible, TypeNotDefaultConstructible, + StlWrapperHeapAllocForbidden, }; @@ -44,7 +46,9 @@ namespace rtl return "Empty instance: RObject does not hold any reflected object"; case error::SignatureMismatch: return "Signature mismatch: Function parameters do not match the expected signature"; - case error::FunctionNotRegisterd: + case error::CloningDisabled: + return "Type not registered: The requested type is not explicitly registered in the Reflection system"; + case error::FunctionNotRegistered: return "Function not registered: The requested function/method is not registered in the Reflection system"; case error::TargetMismatch: return "The object you're trying to bind doesn't match the expected type of the method."; diff --git a/ReflectionTemplateLib/common/rtl_traits.h b/ReflectionTemplateLib/common/rtl_traits.h index d5bc1f89..323c6af3 100644 --- a/ReflectionTemplateLib/common/rtl_traits.h +++ b/ReflectionTemplateLib/common/rtl_traits.h @@ -24,10 +24,21 @@ namespace rtl { + class RObject; + + namespace detail { + + template + class FunctorContainer; + } + namespace traits { using Converter = std::function< std::any(const std::any&, const detail::EntityKind&, detail::EntityKind&) >; + using ConverterPair = std::pair< std::size_t, Converter >; + + using Cloner = detail::FunctorContainer; } namespace traits diff --git a/ReflectionTemplateLib/detail/inc/CallReflector.h b/ReflectionTemplateLib/detail/inc/CallReflector.h index 1295f459..11a35880 100644 --- a/ReflectionTemplateLib/detail/inc/CallReflector.h +++ b/ReflectionTemplateLib/detail/inc/CallReflector.h @@ -15,51 +15,49 @@ #include "RObject.h" #include "Constants.h" -namespace rtl { +namespace rtl::detail { - namespace detail + +/* @struct: CallReflector + @param: _derivedType (type which inherits this class) + * retrieves the lambda at given index and calls it with the arguments supplied. + * deriving classes are, MethodContainer & FunctorContainer. +*/ template + struct CallReflector { - /* @struct: CallReflector - @param: _derivedType (type which inherits this class) - * retrieves the lambda at given index and calls it with the arguments supplied. - * deriving classes are, MethodContainer & FunctorContainer. - */ template - struct CallReflector + /* @method: forwardCall + @param: pFunctorIndex (index of the lambda), _args...(arguments to be passed to that lambda) + * gets the lambda vector from '_derivedType' and calls the lambda at given index with '_args'. + * this 'forwardCall' is for calling lambda containing non-member-function and static-member-function functors. + */ template + static Return forwardCall(std::size_t pFunctorIndex, _params&&..._args) { - /* @method: forwardCall - @param: pFunctorIndex (index of the lambda), _args...(arguments to be passed to that lambda) - * gets the lambda vector from '_derivedType' and calls the lambda at given index with '_args'. - * this 'forwardCall' is for calling lambda containing non-member-function and static-member-function functors. - */ template - static Return forwardCall(std::size_t pFunctorIndex, _params&&..._args) - { - //'getFunctors()' must be implemented by _derivedType (FunctorContainer). - return _derivedType::getFunctors().at(pFunctorIndex)(std::forward<_params>(_args)...); - } + //'getFunctors()' must be implemented by _derivedType (FunctorContainer). + return _derivedType::getFunctors().at(pFunctorIndex)(std::forward<_params>(_args)...); + } - /* @method: forwardCall - @param: pFunctorIndex (index of the lambda), _args...(arguments to be passed to that lambda) - * gets the lambda vector from '_derivedType' and calls the lambda at given index with '_args'. - * this 'forwardCall' is for calling lambda containing constructors. - */ template - static Return forwardCall(rtl::alloc&& pAllocType, std::size_t pFunctorIndex, _params&&..._args) - { - //'getFunctors()' must be implemented by _derivedType (FunctorContainer). - return _derivedType::getFunctors().at(pFunctorIndex)(std::forward(pAllocType), std::forward<_params>(_args)...); - } + /* @method: forwardCall + @param: pFunctorIndex (index of the lambda), _args...(arguments to be passed to that lambda) + * gets the lambda vector from '_derivedType' and calls the lambda at given index with '_args'. + * this 'forwardCall' is for calling lambda containing constructors. + */ template + static Return forwardCall(std::size_t pFunctorIndex, rtl::alloc pAllocType, std::size_t pClonerIndex, _params&&..._args) + { + //'getFunctors()' must be implemented by _derivedType (FunctorContainer). + return _derivedType::getFunctors().at(pFunctorIndex)(pAllocType, pClonerIndex, std::forward<_params>(_args)...); + } - /* @method: forwardCall - @param: pFunctorIndex (index of the lambda), _args...(arguments to be passed to that lambda) - * gets the lambda vector from '_derivedType' and calls the lambda at given index with '_args'. - * this 'forwardCall' is for calling lambda containing member-function functors. - */ template - static Return forwardCall(const rtl::RObject& pTarget, std::size_t pFunctorIndex, _params&&..._args) - { - //'getMethodFunctors()' is implemented by _derivedType (MethodContainer) - return _derivedType::getMethodFunctors().at(pFunctorIndex)(pTarget, std::forward<_params>(_args)...); - } - }; - } + /* @method: forwardCall + @param: pFunctorIndex (index of the lambda), _args...(arguments to be passed to that lambda) + * gets the lambda vector from '_derivedType' and calls the lambda at given index with '_args'. + * this 'forwardCall' is for calling lambda containing member-function functors. + */ template + static Return forwardCall(const rtl::RObject& pTarget, std::size_t pFunctorIndex, _params&&..._args) + { + //'getMethodFunctors()' is implemented by _derivedType (MethodContainer) + return _derivedType::getMethodFunctors().at(pFunctorIndex)(pTarget, std::forward<_params>(_args)...); + } + }; } \ No newline at end of file diff --git a/ReflectionTemplateLib/detail/inc/FunctorId.h b/ReflectionTemplateLib/detail/inc/FunctorId.h index 6752c32c..5fee2669 100644 --- a/ReflectionTemplateLib/detail/inc/FunctorId.h +++ b/ReflectionTemplateLib/detail/inc/FunctorId.h @@ -25,7 +25,7 @@ namespace rtl * once table is found, the functor is accessed at index 'm_index', (never fails, noexcept) * 'FunctorId' generated for a each functor is unique, even for overloaded functions. * multiple registartion of same functor will generate same duplicate 'FunctorId'. - */ class FunctorId + */ struct FunctorId { //index of the functor in the functor-table. std::size_t m_index; @@ -42,47 +42,36 @@ namespace rtl //signature of functor as string. platform dependent, may not be very much readable format. std::string m_signature; - public: - - FunctorId(FunctorId&&) = default; - FunctorId(const FunctorId&) = default; - FunctorId& operator=(FunctorId&&) = default; - FunctorId& operator=(const FunctorId&) = default; - - FunctorId() - : m_index(rtl::index_none) - , m_returnId(TypeId<>::None) - , m_recordId(TypeId<>::None) - , m_containerId(TypeId<>::None) - , m_signature("") - { } - - FunctorId(std::size_t pIndex, - std::size_t pReturnId, std::size_t pRecordId, - std::size_t pContainerId, const std::string& pSignature) - : m_index(pIndex) - , m_returnId(pReturnId) - , m_recordId(pRecordId) - , m_containerId(pContainerId) - , m_signature(pSignature) - { } - - GETTER(std::size_t, Index, m_index) GETTER(std::size_t, ReturnId, m_returnId); GETTER(std::size_t, RecordId, m_recordId); GETTER(std::size_t, SignatureId, m_containerId) GETTER(std::string, SignatureStr, m_signature) - + + /* @method: getHashCode() + @return: std::size_t (a unique hash-code for a functor) + * 'm_containerId' will be same for functors(non-member) with same signatures. + * for member functions, a functor will have three atrributes + - signature + - whether it is const or non-const + - class/struct type + 'm_containerId' will be same for functors with same above attributes. + * every functor will have a distinct index in the functor-wrapped-lambda-table. + * so, combination of m_containerId & m_index is unique for every functor. + */ std::size_t getHashCode() const + { + return std::stoull(std::to_string(m_containerId) + + std::to_string(m_index) + + std::to_string(m_recordId) + + std::to_string(m_returnId)); + } + const bool operator==(const FunctorId& pOther) const { - return (m_index == pOther.m_index && m_returnId == pOther.m_returnId && + return (m_index == pOther.m_index && m_returnId == pOther.m_returnId && m_recordId == pOther.m_recordId && m_containerId == pOther.m_containerId && m_signature == pOther.m_signature); } - - //get a unique hascode representing a functor. - std::size_t getHashCode() const; }; } } \ No newline at end of file diff --git a/ReflectionTemplateLib/detail/inc/RObjExtracter.h b/ReflectionTemplateLib/detail/inc/RObjExtracter.h index 723a4075..0b5306d7 100644 --- a/ReflectionTemplateLib/detail/inc/RObjExtracter.h +++ b/ReflectionTemplateLib/detail/inc/RObjExtracter.h @@ -47,13 +47,13 @@ namespace rtl::detail switch (m_rObj.m_objectId.m_containsAs) { case EntityKind::Ref: { - return std::any_cast(m_rObj.m_object); + return std::any_cast(m_rObj.m_object.value()); } case EntityKind::Wrapper: { return getFromWrapper(); } case EntityKind::Value: { - const T& valueRef = std::any_cast(m_rObj.m_object); + const T& valueRef = std::any_cast(m_rObj.m_object.value()); return static_cast(&valueRef); } default: return nullptr; @@ -73,14 +73,14 @@ namespace rtl::detail if (m_rObj.m_objectId.m_isWrappingConst) { using U = detail::RObjectUPtr; - const U& uptrRef = std::any_cast(m_rObj.m_object); + const U& uptrRef = std::any_cast(m_rObj.m_object.value()); return static_cast(&uptrRef); } } else { using U = detail::RObjectUPtr<_T>; - const U& uptrRef = std::any_cast(m_rObj.m_object); + const U& uptrRef = std::any_cast(m_rObj.m_object.value()); return static_cast(&uptrRef); } } @@ -98,14 +98,14 @@ namespace rtl::detail { if (m_rObj.m_objectId.m_isWrappingConst) { using U = std::shared_ptr; - const U& sptrRef = std::any_cast(m_rObj.m_object); + const U& sptrRef = std::any_cast(m_rObj.m_object.value()); return static_cast(&sptrRef); } } else { using U = std::shared_ptr<_T>; - const U& sptrRef = std::any_cast(m_rObj.m_object); + const U& sptrRef = std::any_cast(m_rObj.m_object.value()); return static_cast(&sptrRef); } } @@ -122,12 +122,12 @@ namespace rtl::detail { if (m_rObj.m_objectId.m_isWrappingConst) { using U = detail::RObjectUPtr; - const U& uptrRef = std::any_cast(m_rObj.m_object); + const U& uptrRef = std::any_cast(m_rObj.m_object.value()); return static_cast(uptrRef.get()); } else { using U = detail::RObjectUPtr; - const U& uptrRef = std::any_cast(m_rObj.m_object); + const U& uptrRef = std::any_cast(m_rObj.m_object.value()); return static_cast(uptrRef.get()); } } @@ -135,12 +135,12 @@ namespace rtl::detail { if (m_rObj.m_objectId.m_isWrappingConst) { using U = std::shared_ptr; - const auto& sptrRef = std::any_cast(m_rObj.m_object); + const auto& sptrRef = std::any_cast(m_rObj.m_object.value()); return static_cast(sptrRef.get()); } else { using U = std::shared_ptr; - const auto& sptrRef = std::any_cast(m_rObj.m_object); + const auto& sptrRef = std::any_cast(m_rObj.m_object.value()); return static_cast(sptrRef.get()); } } diff --git a/ReflectionTemplateLib/detail/inc/RObjectBuilder.h b/ReflectionTemplateLib/detail/inc/RObjectBuilder.h index 5ea9619e..b847dacc 100644 --- a/ReflectionTemplateLib/detail/inc/RObjectBuilder.h +++ b/ReflectionTemplateLib/detail/inc/RObjectBuilder.h @@ -27,10 +27,10 @@ namespace rtl::detail RObjectBuilder(const RObjectBuilder&) = delete; template requires (_allocOn == alloc::Heap) - static RObject build(T&& pVal, bool pIsConstCastSafe) noexcept; + static RObject build(T&& pVal, std::size_t pClonerIndex, bool pIsConstCastSafe) noexcept; template requires (_allocOn == alloc::Stack) - static RObject build(T&& pVal, bool pIsConstCastSafe) noexcept; + static RObject build(T&& pVal, std::size_t pClonerIndex, bool pIsConstCastSafe) noexcept; }; } @@ -48,11 +48,11 @@ namespace rtl { if constexpr (std::is_same_v, char>) { return detail::RObjectBuilder::template - build(std::string_view(pArr, N - 1), !traits::is_const_v); + build(std::string_view(pArr, N - 1), rtl::index_none, !traits::is_const_v); } else { return detail::RObjectBuilder>::template - build(std::vector(pArr, pArr + N), !traits::is_const_v); + build(std::vector(pArr, pArr + N), rtl::index_none, !traits::is_const_v); } } @@ -64,13 +64,13 @@ namespace rtl if constexpr (traits::std_wrapper<_T>::type == detail::Wrapper::None) { return detail::RObjectBuilder::template - build(std::forward(pVal), !traits::is_const_v); + build(std::forward(pVal), rtl::index_none, !traits::is_const_v); } else { constexpr bool isConstCastSafe = !traits::is_const_v::value_type>; return detail::RObjectBuilder::template - build(std::forward(pVal), isConstCastSafe); + build(std::forward(pVal), rtl::index_none, isConstCastSafe); } } } \ No newline at end of file diff --git a/ReflectionTemplateLib/detail/inc/RObjectBuilder.hpp b/ReflectionTemplateLib/detail/inc/RObjectBuilder.hpp index 6c0f3e48..5de6e142 100644 --- a/ReflectionTemplateLib/detail/inc/RObjectBuilder.hpp +++ b/ReflectionTemplateLib/detail/inc/RObjectBuilder.hpp @@ -17,10 +17,8 @@ #include "RObjectUPtr.h" #include "RObjectBuilder.h" -namespace rtl::detail { - - using Cloner = std::function< Return(const RObject&, rtl::alloc) >; - +namespace rtl::detail +{ template FORCE_INLINE const std::vector& getConverters() noexcept { @@ -31,69 +29,24 @@ namespace rtl::detail { return rtl::detail::ReflectCast<_T>::getConversions(); } - template - FORCE_INLINE const Cloner& buildCloner() noexcept - { - using W = traits::std_wrapper; - using _T = std::conditional_t; - - if constexpr (std::is_copy_constructible_v<_T>) - { - static const Cloner cloner = [](const RObject& pOther, alloc pAllocOn) -> Return - { - const auto& srcObj = pOther.view<_T>()->get(); - switch (pAllocOn) - { - case alloc::Stack: - return { - error::None, - RObjectBuilder<_T>::template build(_T(srcObj), true) - }; - case alloc::Heap: - return { - error::None, - RObjectBuilder<_T*>::template build(new _T(srcObj), true) - }; - default: - return { - error::EmptyRObject, - RObject{} - }; - } - }; - return cloner; - } - else - { - static const Cloner cloner = [](const RObject&, alloc) -> Return { - return { - error::TypeNotCopyConstructible, - RObject{} - }; - }; - return cloner; - } - } - template template requires (_allocOn == alloc::Heap) - FORCE_INLINE RObject RObjectBuilder::build(T&& pVal, bool pIsConstCastSafe) noexcept + FORCE_INLINE RObject RObjectBuilder::build(T&& pVal, std::size_t pClonerIndex, bool pIsConstCastSafe) noexcept { using _T = traits::raw_t; return RObject( std::any{ std::in_place_type>, RObjectUPtr<_T>(std::unique_ptr<_T>(static_cast<_T*>(pVal))) }, - RObjectId::create, alloc::Heap>(pIsConstCastSafe), - &buildCloner<_T>(), + RObjectId::create, alloc::Heap>(pClonerIndex, pIsConstCastSafe), &getConverters>()); } template template requires (_allocOn == alloc::Stack) - FORCE_INLINE RObject RObjectBuilder::build(T&& pVal, bool pIsConstCastSafe) noexcept + FORCE_INLINE RObject RObjectBuilder::build(T&& pVal, std::size_t pClonerIndex, bool pIsConstCastSafe) noexcept { using _T = traits::raw_t; constexpr bool isRawPointer = std::is_pointer_v>; @@ -101,8 +54,7 @@ namespace rtl::detail { if constexpr (isRawPointer) { return RObject( std::any { static_cast(pVal) }, - RObjectId::create(pIsConstCastSafe), - &buildCloner<_T>(), + RObjectId::create(pClonerIndex, pIsConstCastSafe), &getConverters() ); } else @@ -114,8 +66,7 @@ namespace rtl::detail { std::in_place_type>, RObjectUPtr(std::move(pVal)) }, - RObjectId::create(pIsConstCastSafe), - &buildCloner<_T>(), + RObjectId::create(pClonerIndex, pIsConstCastSafe), &getConverters() ); } else @@ -125,8 +76,7 @@ namespace rtl::detail { std::in_place_type, std::forward(pVal) }, - RObjectId::create(pIsConstCastSafe), - &buildCloner<_T>(), + RObjectId::create(pClonerIndex, pIsConstCastSafe), &getConverters() ); } } diff --git a/ReflectionTemplateLib/detail/inc/RObjectId.h b/ReflectionTemplateLib/detail/inc/RObjectId.h index a5d5decc..a8a65978 100644 --- a/ReflectionTemplateLib/detail/inc/RObjectId.h +++ b/ReflectionTemplateLib/detail/inc/RObjectId.h @@ -27,6 +27,7 @@ namespace rtl::detail bool m_isConstCastSafe; std::size_t m_typeId; + std::size_t m_clonerIndex; std::size_t m_wrapperTypeId; alloc m_allocatedOn; @@ -57,7 +58,7 @@ namespace rtl::detail template - FORCE_INLINE static RObjectId create(bool pIsConstCastSafe) noexcept + FORCE_INLINE static RObjectId create(std::size_t pClonerIndex, bool pIsConstCastSafe) noexcept { // extract wrapper info. using _W = traits::std_wrapper>; @@ -68,7 +69,7 @@ namespace rtl::detail const std::size_t wrapperId = _W::id(); const std::size_t typeId = rtl::detail::TypeId<_T>::get(); constexpr bool isWrappingConst = (_W::type != Wrapper::None && traits::is_const_v); - return RObjectId{ isWrappingConst, pIsConstCastSafe, typeId, wrapperId, _allocOn, _W::type, entityKind }; + return RObjectId{ isWrappingConst, pIsConstCastSafe, typeId, pClonerIndex, wrapperId, _allocOn, _W::type, entityKind }; } }; } \ No newline at end of file diff --git a/ReflectionTemplateLib/detail/inc/ReflectionBuilder.hpp b/ReflectionTemplateLib/detail/inc/ReflectionBuilder.hpp index 660e2b3e..29e96bb4 100644 --- a/ReflectionTemplateLib/detail/inc/ReflectionBuilder.hpp +++ b/ReflectionTemplateLib/detail/inc/ReflectionBuilder.hpp @@ -43,7 +43,6 @@ namespace rtl::detail { using Container = FunctorContainer< traits::remove_const_if_not_reference<_signature>...>; const FunctorId& functorId = Container::template addFunctor<_returnType, _signature...>(pFunctor, m_recordId); - //assert(functorId.getRecordId() == m_recordId && "function pointer is not member-function of specified record type"); return Function(m_namespace, m_record, m_function, functorId, m_recordId, methodQ::None); } @@ -88,9 +87,12 @@ namespace rtl::detail */ template inline const Function ReflectionBuilder::buildConstructor() const { - using Container = FunctorContainer...>; + using Container = FunctorContainer < rtl::alloc, std::size_t, traits::remove_const_if_not_reference<_ctorSignature>... > ; const FunctorId& functorId = Container::template addConstructor<_recordType, _ctorSignature...>(); - - return Function(m_namespace, m_record, m_function, functorId, m_recordId, methodQ::None); + const FunctorId& copyCtorId = traits::Cloner::template addCopyConstructor<_recordType, const RObject&>(); + const Function& ctorFunction = Function(m_namespace, m_record, m_function, functorId, m_recordId, methodQ::None); + + ctorFunction.getFunctorIds().push_back(copyCtorId); + return ctorFunction; } } diff --git a/ReflectionTemplateLib/detail/inc/SetupConstructor.h b/ReflectionTemplateLib/detail/inc/SetupConstructor.h index bc65908e..44d06345 100644 --- a/ReflectionTemplateLib/detail/inc/SetupConstructor.h +++ b/ReflectionTemplateLib/detail/inc/SetupConstructor.h @@ -15,6 +15,8 @@ namespace rtl { + class RObject; + namespace detail { /* @struct: SetupConstructor @@ -26,16 +28,22 @@ namespace rtl { class SetupConstructor { template - using CtorLambda = std::function < Return(alloc, _signature...) >; + using CtorLambda = std::function < Return(alloc, std::size_t, _signature...) >; template static CtorLambda<_signature...> getConstructorCaller(); + template + static CtorLambda<_signature...> getCopyConstructorCaller(); + protected: //adds the lambda, wrapping constructor call, recordType(_signature...), to '_derivedType' (FunctorContainer) template static const detail::FunctorId addConstructor(); + + template + static const detail::FunctorId addCopyConstructor(); }; } } \ No newline at end of file diff --git a/ReflectionTemplateLib/detail/inc/SetupConstructor.hpp b/ReflectionTemplateLib/detail/inc/SetupConstructor.hpp index a84ff3ea..90f6fd14 100644 --- a/ReflectionTemplateLib/detail/inc/SetupConstructor.hpp +++ b/ReflectionTemplateLib/detail/inc/SetupConstructor.hpp @@ -22,7 +22,7 @@ namespace rtl::detail inline SetupConstructor<_derivedType>::CtorLambda<_signature...> SetupConstructor<_derivedType>::getConstructorCaller() { - return [](alloc pAllocType, _signature&&...params)-> Return + return [](alloc pAllocType, std::size_t pClonerIndex, _signature&&...params)-> Return { if constexpr (sizeof...(_signature) == 0 && !std::is_default_constructible_v<_recordType>) { //default constructor, private or deleted. @@ -33,19 +33,23 @@ namespace rtl::detail if (pAllocType == alloc::Stack) { if constexpr (!std::is_copy_constructible_v<_recordType>) { - return { error::TypeNotCopyConstructible, RObject{} }; + return { + error::TypeNotCopyConstructible, RObject{} + }; } else { - return { error::None, - RObjectBuilder<_recordType>::template - build(_recordType(std::forward<_signature>(params)...), true) + return { + error::None, + RObjectBuilder<_recordType>::template + build(_recordType(std::forward<_signature>(params)...), pClonerIndex, true) }; } } else if (pAllocType == alloc::Heap) { - return { error::None, - RObjectBuilder<_recordType*>::template - build(new _recordType(std::forward<_signature>(params)...), true) + return { + error::None, + RObjectBuilder<_recordType*>::template + build(new _recordType(std::forward<_signature>(params)...), pClonerIndex, true) }; } } @@ -54,6 +58,51 @@ namespace rtl::detail } + + template + template + inline SetupConstructor<_derivedType>::CtorLambda<_signature...> + SetupConstructor<_derivedType>::getCopyConstructorCaller() + { + if constexpr (std::is_copy_constructible_v<_recordType>) + { + return [](alloc pAllocOn, std::size_t pClonerIndex, const RObject& pOther) -> Return + { + const auto& srcObj = pOther.view<_recordType>()->get(); + switch (pAllocOn) + { + case alloc::Stack: + return { + error::None, + RObjectBuilder<_recordType>::template build(_recordType(srcObj), pClonerIndex, true) + }; + case alloc::Heap: + return { + error::None, + RObjectBuilder<_recordType*>::template build(new _recordType(srcObj), pClonerIndex, true) + }; + default: + return { + error::EmptyRObject, + RObject{} + }; + } + }; + } + else + { + return [](alloc pAllocOn, std::size_t pClonerIndex, const RObject&) -> Return + { + return { + error::TypeNotCopyConstructible, + RObject{} + }; + }; + } + } + + + /* @method: addConstructor() @param: '_derivedType' (FunctorContainer), '_recordType' (class/struct), '_signature...' (ctor's args, explicitly specified) @return: 'FunctorId' object, a hash-key to lookup the lambda in the _derivedType's lambda-table. @@ -72,6 +121,35 @@ namespace rtl::detail //maintaining a set of already registered constructors. static std::map ctorSet; + //will be called from '_derivedType' if the constructor not already registered. + const auto& updateIndex = [&](std::size_t pIndex)->void { + ctorSet.insert(std::make_pair(hashKey, pIndex)); + }; + + //will be called from '_derivedType' to check if the constructor already registered. + const auto& getIndex = [&]()-> std::size_t { + const auto& itr = ctorSet.find(hashKey); + return (itr != ctorSet.end() ? itr->second : index_none); + }; + + //add the lambda in 'FunctorContainer'. + std::size_t index = _derivedType::pushBack(getConstructorCaller<_recordType, _signature...>(), getIndex, updateIndex); + const auto& signatureStr = _derivedType::template getSignatureStr<_recordType>(true); + return detail::FunctorId(index, recordId, recordId, containerId, signatureStr); + } + + + template + template + inline const detail::FunctorId SetupConstructor<_derivedType>::addCopyConstructor() + { + std::size_t recordId = TypeId<_recordType>::get(); + std::size_t containerId = _derivedType::getContainerId(); + std::size_t hashKey = std::stoull(std::to_string(containerId) + std::to_string(recordId)); + + //maintaining a set of already registered constructors. + static std::map ctorSet; + //will be called from '_derivedType' if the constructor not already registered. const auto& updateIndex = [&](std::size_t pIndex)->void { ctorSet.insert(std::make_pair(hashKey, pIndex)); @@ -84,7 +162,7 @@ namespace rtl::detail }; //add the lambda in 'FunctorContainer'. - std::size_t index = _derivedType::pushBack(getConstructorCaller<_recordType, _signature...>(), getIndex, updateIndex); + std::size_t index = _derivedType::pushBack(getCopyConstructorCaller<_recordType, _signature...>(), getIndex, updateIndex); const auto& signatureStr = _derivedType::template getSignatureStr<_recordType>(true); return detail::FunctorId(index, recordId, recordId, containerId, signatureStr); } diff --git a/ReflectionTemplateLib/detail/inc/SetupFunction.hpp b/ReflectionTemplateLib/detail/inc/SetupFunction.hpp index f76bbbf4..c044e666 100644 --- a/ReflectionTemplateLib/detail/inc/SetupFunction.hpp +++ b/ReflectionTemplateLib/detail/inc/SetupFunction.hpp @@ -49,7 +49,7 @@ namespace rtl const _rawRetType& retObj = pFunctor(std::forward<_signature>(params)...); return { error::None, RObjectBuilder::template - build(&retObj, isConstCastSafe) + build(&retObj, rtl::index_none, isConstCastSafe) }; } else { @@ -59,7 +59,7 @@ namespace rtl return { error::None, RObjectBuilder::template - build(std::forward(retObj), isConstCastSafe) + build(std::forward(retObj), rtl::index_none, isConstCastSafe) }; } }; @@ -108,9 +108,12 @@ namespace rtl const std::size_t retTypeId = TypeId>::get(); //finally add the lambda 'functor' in 'FunctorContainer' lambda vector and get the index. const std::size_t index = _derivedType::pushBack(getCaller(pFunctor), getIndex, updateIndex); + //construct the hash-key 'FunctorId' and return. - return detail::FunctorId(index, retTypeId, pRecordId, _derivedType::getContainerId(), - _derivedType::template getSignatureStr<_returnType>()); + return detail::FunctorId{ + index, retTypeId, pRecordId, _derivedType::getContainerId(), + _derivedType::template getSignatureStr<_returnType>() + }; } } } \ No newline at end of file diff --git a/ReflectionTemplateLib/detail/inc/SetupMethod.hpp b/ReflectionTemplateLib/detail/inc/SetupMethod.hpp index 4f64ee7a..b7d4d125 100644 --- a/ReflectionTemplateLib/detail/inc/SetupMethod.hpp +++ b/ReflectionTemplateLib/detail/inc/SetupMethod.hpp @@ -65,7 +65,7 @@ namespace rtl const _rawRetType& retObj = (target.*pFunctor)(std::forward<_signature>(params)...); return { error::None, RObjectBuilder::template - build(&retObj, isConstCastSafe) + build(&retObj, rtl::index_none, isConstCastSafe) }; } else { @@ -75,7 +75,7 @@ namespace rtl return { error::None, RObjectBuilder::template - build(std::forward(retObj), isConstCastSafe) + build(std::forward(retObj), rtl::index_none, isConstCastSafe) }; } }; @@ -118,7 +118,7 @@ namespace rtl const _rawRetType& retObj = (target.*pFunctor)(std::forward<_signature>(params)...); return { error::None, RObjectBuilder::template - build(&retObj, isConstCastSafe) + build(&retObj, rtl::index_none, isConstCastSafe) }; } else { @@ -128,7 +128,7 @@ namespace rtl return { error::None, RObjectBuilder::template - build(std::forward(retObj), isConstCastSafe) + build(std::forward(retObj), rtl::index_none, isConstCastSafe) }; } }; @@ -181,15 +181,19 @@ namespace rtl { const std::size_t index = _derivedType::pushBack(getVoidMethodCaller(pFunctor), getIndex, updateIndex); //construct the hash-key 'FunctorId' and return. - return detail::FunctorId(index, retTypeId, TypeId<_recordType>::get(), _derivedType::getContainerId(), - _derivedType::template getSignatureStr<_recordType, _returnType>()); + return detail::FunctorId{ + index, retTypeId, TypeId<_recordType>::get(), _derivedType::getContainerId(), + _derivedType::template getSignatureStr<_recordType, _returnType>() + }; } else { const std::size_t index = _derivedType::pushBack(getMethodCaller(pFunctor), getIndex, updateIndex); //construct the hash-key 'FunctorId' and return. - return detail::FunctorId(index, retTypeId, TypeId<_recordType>::get(), _derivedType::getContainerId(), - _derivedType::template getSignatureStr<_recordType, _returnType>()); + return detail::FunctorId { + index, retTypeId, TypeId<_recordType>::get(), _derivedType::getContainerId(), + _derivedType::template getSignatureStr<_recordType, _returnType>() + }; } } @@ -237,15 +241,19 @@ namespace rtl { const std::size_t index = _derivedType::pushBack(getVoidMethodCaller(pFunctor), getIndex, updateIndex); //construct the hash-key 'FunctorId' and return. - return detail::FunctorId(index, retTypeId, TypeId<_recordType>::get(), _derivedType::getContainerId(), - _derivedType::template getSignatureStr<_recordType, _returnType>()); + return detail::FunctorId { + index, retTypeId, TypeId<_recordType>::get(), _derivedType::getContainerId(), + _derivedType::template getSignatureStr<_recordType, _returnType>() + }; } else { const std::size_t index = _derivedType::pushBack(getMethodCaller(pFunctor), getIndex, updateIndex); //construct the hash-key 'FunctorId' and return. - return detail::FunctorId(index, retTypeId, TypeId<_recordType>::get(), _derivedType::getContainerId(), - _derivedType::template getSignatureStr<_recordType, _returnType>()); + return detail::FunctorId { + index, retTypeId, TypeId<_recordType>::get(), _derivedType::getContainerId(), + _derivedType::template getSignatureStr<_recordType, _returnType>() + }; } } } diff --git a/ReflectionTemplateLib/detail/src/CMakeLists.txt b/ReflectionTemplateLib/detail/src/CMakeLists.txt index d7be430f..46ec416a 100644 --- a/ReflectionTemplateLib/detail/src/CMakeLists.txt +++ b/ReflectionTemplateLib/detail/src/CMakeLists.txt @@ -1,7 +1,6 @@ # Create a variable containing the source files for your target set(LOCAL_SOURCES "${CMAKE_CURRENT_LIST_DIR}/CxxReflection.cpp" - "${CMAKE_CURRENT_LIST_DIR}/FunctorId.cpp" "${CMAKE_CURRENT_LIST_DIR}/ReflectCast.cpp" "${CMAKE_CURRENT_LIST_DIR}/RObjectConverters_string.cpp" ) diff --git a/ReflectionTemplateLib/detail/src/FunctorId.cpp b/ReflectionTemplateLib/detail/src/FunctorId.cpp deleted file mode 100644 index 6110de8d..00000000 --- a/ReflectionTemplateLib/detail/src/FunctorId.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/************************************************************************* - * * - * Reflection Template Library (RTL) - Modern C++ Reflection Framework * - * https://github.com/ReflectCxx/ReflectionTemplateLibrary-CPP * - * * - * Copyright (c) 2025 Neeraj Singh * - * SPDX-License-Identifier: MIT * - * * - *************************************************************************/ - - -#include "FunctorId.h" - -namespace rtl -{ - namespace detail - { - /* @method: getHashCode() - @return: std::size_t (a unique hash-code for a functor) - * 'm_containerId' will be same for functors(non-member) with same signatures. - * for member functions, a functor will have three atrributes - - signature - - whether it is const or non-const - - class/struct type - 'm_containerId' will be same for functors with same above attributes. - * every functor will have a distinct index in the functor-wrapped-lambda-table. - * so, combination of m_containerId & m_index is unique for every functor. - */ std::size_t FunctorId::getHashCode() const - { - return std::stoull(std::to_string(m_containerId) + - std::to_string(m_index) + - std::to_string(m_recordId) + - std::to_string(m_returnId)); - } - } -} \ No newline at end of file From 7bfc6c824d7a861a42472153f72c5db0a39bf141 Mon Sep 17 00:00:00 2001 From: neeraj Date: Wed, 10 Sep 2025 14:21:42 +0530 Subject: [PATCH 2/6] removed .at(), static-cache encouraging inlining, BM with functor-dref. --- CxxTestProps/src/Date.cpp | 8 ++-- RTLBenchmarkApp/src/BenchMark.cpp | 40 +++++++++---------- RTLBenchmarkApp/src/BenchMark.h | 23 +++-------- RTLBenchmarkApp/src/main.cpp | 4 ++ ReflectionTemplateLib/access/inc/Function.hpp | 2 +- ReflectionTemplateLib/access/inc/RObject.hpp | 4 +- ReflectionTemplateLib/access/inc/Record.h | 3 +- .../access/src/CxxMirror.cpp | 4 +- .../detail/inc/CallReflector.h | 12 +++--- .../detail/inc/FunctionCaller.hpp | 2 +- .../detail/inc/FunctorContainer.h | 7 ++-- .../detail/inc/MethodContainer.h | 12 +++--- .../detail/inc/SetupConstructor.hpp | 4 +- 13 files changed, 60 insertions(+), 65 deletions(-) diff --git a/CxxTestProps/src/Date.cpp b/CxxTestProps/src/Date.cpp index cc96d73d..a3b76538 100644 --- a/CxxTestProps/src/Date.cpp +++ b/CxxTestProps/src/Date.cpp @@ -151,12 +151,12 @@ namespace nsdate vector date; for (size_t i = 0; i < pDateStr.length(); i++) { - if (pDateStr.at(i) == '/') { + if (pDateStr[i] == '/') { date.push_back(strBuf); strBuf.clear(); } else { - strBuf.push_back(pDateStr.at(i)); + strBuf.push_back(pDateStr[i]); } } m_day = stoi(date[0]); @@ -208,12 +208,12 @@ namespace nsdate vector date; for (size_t i = 0; i < pDateStr.length(); i++) { - if (pDateStr.at(i) == '/') { + if (pDateStr[i] == '/') { date.push_back(strBuf); strBuf.clear(); } else { - strBuf.push_back(pDateStr.at(i)); + strBuf.push_back(pDateStr[i]); } } m_day = stoi(date[0]); diff --git a/RTLBenchmarkApp/src/BenchMark.cpp b/RTLBenchmarkApp/src/BenchMark.cpp index 7ba11f9d..7ef71f17 100644 --- a/RTLBenchmarkApp/src/BenchMark.cpp +++ b/RTLBenchmarkApp/src/BenchMark.cpp @@ -9,24 +9,31 @@ namespace { static const char* LONG_STR = "Lorem ipsum"; - // dolor sit amet, consectetur adipiscing elit, sed do" - //"do aeiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis" - //"nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure" - //"dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Except" - //"eur ssint occaecat cupidatat nnon proident, sunt in culpa qui officia deserunt mollit anim id" - //"Lorem ipsum dolor sit amet laboris nisi ut aliquip ex ea commodo"; + // dolor sit amet, consectetur adipiscing elit, sed do" + // "do aeiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis" + // "nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure" + // "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Except" + // "eur ssint occaecat cupidatat nnon proident, sunt in culpa qui officia deserunt mollit anim id" + // "Lorem ipsum dolor sit amet laboris nisi ut aliquip ex ea commodo"; } // Pre-created string to isolate call overhead -static argStr_t g_longStr(LONG_STR); +argStr_t g_longStr(LONG_STR); + +extern decltype(&rtl_bench::getMessage) getMessagePtr; +extern decltype(&rtl_bench::sendMessage) sendMessagePtr; +extern decltype(&rtl_bench::Node::getMessage) getMessageNodePtr; +extern decltype(&rtl_bench::Node::sendMessage) sendMessageNodePtr; namespace rtl_bench { + static Node* node = new Node(); + void BenchMark::directCall_noReturn(benchmark::State& state) { for (auto _ : state) { - sendMessage(g_longStr); + sendMessagePtr(g_longStr); benchmark::DoNotOptimize(g_msg); } } @@ -35,7 +42,7 @@ namespace rtl_bench void BenchMark::stdFunctionCall_noReturn(benchmark::State& state) { static std::function sendMsg = [](argStr_t& pMsg) { - sendMessage(pMsg); + sendMessagePtr(pMsg); }; for (auto _ : state) @@ -45,12 +52,10 @@ namespace rtl_bench } } - void BenchMark::stdFunctionMethodCall_noReturn(benchmark::State& state) { - Node* node = new Node(); static std::function sendMsg = [=](argStr_t& pMsg) { - node->sendMessage(pMsg); + (node->*sendMessageNodePtr)(pMsg); }; for (auto _ : state) @@ -79,10 +84,7 @@ namespace rtl_bench void BenchMark::stdFunctionCall_withReturn(benchmark::State& state) { static std::function getMsg = [](argStr_t& pMsg) { - auto msgStr = getMessage(pMsg); - volatile auto* p = &msgStr; - static_cast(p); - return msgStr; + return getMessagePtr(pMsg); }; for (auto _ : state) @@ -94,12 +96,8 @@ namespace rtl_bench void BenchMark::stdFunctionMethodCall_withReturn(benchmark::State& state) { - static Node* node = new Node(); static std::function getMsg = [=](argStr_t& pMsg) { - auto msgStr = node->getMessage(pMsg); - volatile auto* p = &msgStr; - static_cast(p); - return msgStr; + return (node->*getMessageNodePtr)(pMsg); }; for (auto _ : state) diff --git a/RTLBenchmarkApp/src/BenchMark.h b/RTLBenchmarkApp/src/BenchMark.h index 3192d31f..af96d10a 100644 --- a/RTLBenchmarkApp/src/BenchMark.h +++ b/RTLBenchmarkApp/src/BenchMark.h @@ -2,6 +2,8 @@ #include +#include + #include "RTLibInterface.h" #if defined(_MSC_VER) @@ -17,25 +19,18 @@ using retStr_t = std::string_view; #define WORK_LOAD(S) (std::string(S)) - namespace rtl_bench { static std::optional g_msg; NOINLINE static void sendMessage(argStr_t pMsg) { - std::string str = WORK_LOAD(pMsg); - volatile auto* p = &str; - static_cast(p); - g_msg = str; + g_msg = WORK_LOAD(pMsg); } NOINLINE static retStr_t getMessage(argStr_t pMsg) { - std::string str = WORK_LOAD(pMsg); - volatile auto* p = &str; - static_cast(p); - g_msg = str; + g_msg = WORK_LOAD(pMsg); return retStr_t(g_msg->c_str()); } @@ -43,18 +38,12 @@ namespace rtl_bench { NOINLINE void sendMessage(argStr_t pMsg) { - std::string str = WORK_LOAD(pMsg); - volatile auto* p = &str; - static_cast(p); - g_msg = str; + g_msg = WORK_LOAD(pMsg); } NOINLINE retStr_t getMessage(argStr_t pMsg) { - std::string str = WORK_LOAD(pMsg); - volatile auto* p = &str; - static_cast(p); - g_msg = str; + g_msg = WORK_LOAD(pMsg); return retStr_t(g_msg->c_str()); } }; diff --git a/RTLBenchmarkApp/src/main.cpp b/RTLBenchmarkApp/src/main.cpp index ecee3445..19a2a414 100644 --- a/RTLBenchmarkApp/src/main.cpp +++ b/RTLBenchmarkApp/src/main.cpp @@ -4,6 +4,10 @@ #include "BenchMark.h" +auto sendMessagePtr = rtl_bench::sendMessage; +auto getMessagePtr = rtl_bench::getMessage; +auto sendMessageNodePtr = &rtl_bench::Node::sendMessage; +auto getMessageNodePtr = &rtl_bench::Node::getMessage; BENCHMARK(rtl_bench::BenchMark::directCall_noReturn); BENCHMARK(rtl_bench::BenchMark::stdFunctionCall_noReturn); diff --git a/ReflectionTemplateLib/access/inc/Function.hpp b/ReflectionTemplateLib/access/inc/Function.hpp index 02aadb33..a2bd7b8c 100644 --- a/ReflectionTemplateLib/access/inc/Function.hpp +++ b/ReflectionTemplateLib/access/inc/Function.hpp @@ -57,7 +57,7 @@ namespace rtl { //simple linear-search, efficient for small set of elements. for (const auto& functorId : m_functorIds) { - if (functorId.getSignatureId() == pSignatureId) { + if (functorId.getSignatureId() == pSignatureId) [[likely]] { return functorId.getIndex(); } } diff --git a/ReflectionTemplateLib/access/inc/RObject.hpp b/ReflectionTemplateLib/access/inc/RObject.hpp index 7c4e7d4e..619b01a8 100644 --- a/ReflectionTemplateLib/access/inc/RObject.hpp +++ b/ReflectionTemplateLib/access/inc/RObject.hpp @@ -182,7 +182,7 @@ namespace rtl std::size_t pClonerIndex = m_objectId.m_clonerIndex; if (pClonerIndex != rtl::index_none) { - return traits::Cloner::template forwardCall(pClonerIndex, alloc::Heap, pClonerIndex, *this); + return traits::Cloner::template forwardCall(pClonerIndex, alloc::Heap, pClonerIndex, *this); } return { error::CloningDisabled, RObject() }; } @@ -194,7 +194,7 @@ namespace rtl std::size_t pClonerIndex = m_objectId.m_clonerIndex; if (pClonerIndex != rtl::index_none) { - return traits::Cloner::template forwardCall(pClonerIndex, alloc::Stack, pClonerIndex, *this); + return traits::Cloner::template forwardCall(pClonerIndex, alloc::Stack, pClonerIndex, *this); } return { error::CloningDisabled, RObject() }; } diff --git a/ReflectionTemplateLib/access/inc/Record.h b/ReflectionTemplateLib/access/inc/Record.h index 8baa152c..4d70cb18 100644 --- a/ReflectionTemplateLib/access/inc/Record.h +++ b/ReflectionTemplateLib/access/inc/Record.h @@ -65,6 +65,7 @@ namespace rtl { GETTER_CREF(MethodMap, MethodMap, m_methods) GETTER_CREF(std::string, RecordName, m_recordName) + /* @method: getMethod @param: const std::string& (name of the method) @return: std::optional @@ -93,7 +94,7 @@ namespace rtl { { static_assert(_alloc != rtl::alloc::None, "Instance cannot be created with 'rtl::alloc::None' option."); const auto& method = m_methods.at(detail::ctor_name(m_recordName)); - std::size_t copyCtorIndex = method.getFunctorIds().at(detail::Index::CopyCtor).getIndex(); + std::size_t copyCtorIndex = method.getFunctorIds()[detail::Index::CopyCtor].getIndex(); return method.invokeCtor( _alloc, std::move(copyCtorIndex), std::forward<_ctorArgs>(params)...); diff --git a/ReflectionTemplateLib/access/src/CxxMirror.cpp b/ReflectionTemplateLib/access/src/CxxMirror.cpp index af976e0e..16c5f6e4 100644 --- a/ReflectionTemplateLib/access/src/CxxMirror.cpp +++ b/ReflectionTemplateLib/access/src/CxxMirror.cpp @@ -25,14 +25,14 @@ namespace rtl } } - error CxxMirror::enableCloning(const RObject& pTarget) const + error CxxMirror::enableCloning(const RObject& pTarget) const { const auto& itr = getRecordIdMap().find(pTarget.getTypeId()); if (itr != getRecordIdMap().end()) { const Record& record = itr->second; Method ctors = record.getMethod(detail::ctor_name(record.getRecordName())).value(); - const_cast(pTarget).m_objectId.m_clonerIndex = ctors.getFunctors().at(detail::Index::CopyCtor).getIndex(); + const_cast(pTarget).m_objectId.m_clonerIndex = ctors.getFunctors()[detail::Index::CopyCtor].getIndex(); return error::None; } return error::CloningDisabled; diff --git a/ReflectionTemplateLib/detail/inc/CallReflector.h b/ReflectionTemplateLib/detail/inc/CallReflector.h index 11a35880..fad4ecd6 100644 --- a/ReflectionTemplateLib/detail/inc/CallReflector.h +++ b/ReflectionTemplateLib/detail/inc/CallReflector.h @@ -30,10 +30,10 @@ namespace rtl::detail { * gets the lambda vector from '_derivedType' and calls the lambda at given index with '_args'. * this 'forwardCall' is for calling lambda containing non-member-function and static-member-function functors. */ template - static Return forwardCall(std::size_t pFunctorIndex, _params&&..._args) + FORCE_INLINE static Return forwardCall(std::size_t pFunctorIndex, _params&&..._args) { //'getFunctors()' must be implemented by _derivedType (FunctorContainer). - return _derivedType::getFunctors().at(pFunctorIndex)(std::forward<_params>(_args)...); + return _derivedType::getFunctors()[pFunctorIndex](std::forward<_params>(_args)...); } @@ -42,10 +42,10 @@ namespace rtl::detail { * gets the lambda vector from '_derivedType' and calls the lambda at given index with '_args'. * this 'forwardCall' is for calling lambda containing constructors. */ template - static Return forwardCall(std::size_t pFunctorIndex, rtl::alloc pAllocType, std::size_t pClonerIndex, _params&&..._args) + FORCE_INLINE static Return forwardCall(std::size_t pFunctorIndex, rtl::alloc pAllocType, std::size_t pClonerIndex, _params&&..._args) { //'getFunctors()' must be implemented by _derivedType (FunctorContainer). - return _derivedType::getFunctors().at(pFunctorIndex)(pAllocType, pClonerIndex, std::forward<_params>(_args)...); + return _derivedType::getFunctors()[pFunctorIndex](pAllocType, pClonerIndex, std::forward<_params>(_args)...); } @@ -54,10 +54,10 @@ namespace rtl::detail { * gets the lambda vector from '_derivedType' and calls the lambda at given index with '_args'. * this 'forwardCall' is for calling lambda containing member-function functors. */ template - static Return forwardCall(const rtl::RObject& pTarget, std::size_t pFunctorIndex, _params&&..._args) + FORCE_INLINE static Return forwardCall(const rtl::RObject& pTarget, std::size_t pFunctorIndex, _params&&..._args) { //'getMethodFunctors()' is implemented by _derivedType (MethodContainer) - return _derivedType::getMethodFunctors().at(pFunctorIndex)(pTarget, std::forward<_params>(_args)...); + return _derivedType::getMethodFunctors()[pFunctorIndex](pTarget, std::forward<_params>(_args)...); } }; } \ No newline at end of file diff --git a/ReflectionTemplateLib/detail/inc/FunctionCaller.hpp b/ReflectionTemplateLib/detail/inc/FunctionCaller.hpp index 3abe2eab..f3b854be 100644 --- a/ReflectionTemplateLib/detail/inc/FunctionCaller.hpp +++ b/ReflectionTemplateLib/detail/inc/FunctionCaller.hpp @@ -33,7 +33,7 @@ namespace rtl::detail FunctorContainer<_signature...>>; std::size_t index = m_function.hasSignatureId(Container::getContainerId()); - if (index != rtl::index_none) { + if (index != rtl::index_none) [[likely]] { return Container::template forwardCall<_args...>(index, std::forward<_args>(params)...); } return { error::SignatureMismatch, RObject{} }; diff --git a/ReflectionTemplateLib/detail/inc/FunctorContainer.h b/ReflectionTemplateLib/detail/inc/FunctorContainer.h index 618d9ed8..425ad930 100644 --- a/ReflectionTemplateLib/detail/inc/FunctorContainer.h +++ b/ReflectionTemplateLib/detail/inc/FunctorContainer.h @@ -40,14 +40,15 @@ namespace rtl { public: //every FunctorContainer<...> will have a unique-id. - static std::size_t getContainerId() { + FORCE_INLINE static std::size_t getContainerId() { static const std::size_t containerId = generate_unique_id(); return containerId; } //get the vector holding lambdas as 'const-ref' - const static std::vector& getFunctors() { - return getFunctorTable(); + FORCE_INLINE const static std::vector& getFunctors() { + static std::vector& functorTable = getFunctorTable(); + return functorTable; } //get functor container type(_signature...) as string with given 'returnType'. diff --git a/ReflectionTemplateLib/detail/inc/MethodContainer.h b/ReflectionTemplateLib/detail/inc/MethodContainer.h index 0b0fb6df..3a9ec85a 100644 --- a/ReflectionTemplateLib/detail/inc/MethodContainer.h +++ b/ReflectionTemplateLib/detail/inc/MethodContainer.h @@ -52,8 +52,9 @@ namespace rtl { } //get the vector holding lambdas as 'const-ref' - static const std::vector& getMethodFunctors() { - return getFunctorTable(); + FORCE_INLINE static const std::vector& getMethodFunctors() { + static std::vector& functorTable = getFunctorTable(); + return functorTable; } //get container type as string @@ -116,15 +117,16 @@ namespace rtl { public: //every MethodContainer will have a unique-id. - static std::size_t getContainerId() { + FORCE_INLINE static std::size_t getContainerId() { //holds unique-id static const std::size_t containerId = generate_unique_id(); return containerId; } //get the vector holding lambdas as 'const-ref' - static const std::vector& getMethodFunctors() { - return getFunctorTable(); + FORCE_INLINE static const std::vector& getMethodFunctors() { + static std::vector& functorTable = getFunctorTable(); + return functorTable; } //get container type as string diff --git a/ReflectionTemplateLib/detail/inc/SetupConstructor.hpp b/ReflectionTemplateLib/detail/inc/SetupConstructor.hpp index 90f6fd14..e2d025be 100644 --- a/ReflectionTemplateLib/detail/inc/SetupConstructor.hpp +++ b/ReflectionTemplateLib/detail/inc/SetupConstructor.hpp @@ -124,13 +124,13 @@ namespace rtl::detail //will be called from '_derivedType' if the constructor not already registered. const auto& updateIndex = [&](std::size_t pIndex)->void { ctorSet.insert(std::make_pair(hashKey, pIndex)); - }; + }; //will be called from '_derivedType' to check if the constructor already registered. const auto& getIndex = [&]()-> std::size_t { const auto& itr = ctorSet.find(hashKey); return (itr != ctorSet.end() ? itr->second : index_none); - }; + }; //add the lambda in 'FunctorContainer'. std::size_t index = _derivedType::pushBack(getConstructorCaller<_recordType, _signature...>(), getIndex, updateIndex); From 9eba4148878f5eaad0ef34525b9fa782a396942c Mon Sep 17 00:00:00 2001 From: neeraj31285 Date: Wed, 10 Sep 2025 15:22:48 +0530 Subject: [PATCH 3/6] method calling optimized, inlinig, compiler hints. --- ReflectionTemplateLib/access/inc/Function.hpp | 2 +- ReflectionTemplateLib/access/inc/Method.h | 4 +- ReflectionTemplateLib/access/inc/Method.hpp | 30 ++++---- ReflectionTemplateLib/access/inc/RObject.hpp | 4 +- .../detail/inc/MethodInvoker.h | 16 ++-- .../detail/inc/MethodInvoker.hpp | 76 ++++++++----------- 6 files changed, 59 insertions(+), 73 deletions(-) diff --git a/ReflectionTemplateLib/access/inc/Function.hpp b/ReflectionTemplateLib/access/inc/Function.hpp index a2bd7b8c..c4d6e178 100644 --- a/ReflectionTemplateLib/access/inc/Function.hpp +++ b/ReflectionTemplateLib/access/inc/Function.hpp @@ -53,7 +53,7 @@ namespace rtl * a 'Function' object may be associated with multiple functors in case of overloads. * every overload will have unique 'FunctorId', contained by one 'Function' object. * given signatureId is compared against the signatureId of all overloads registered. -*/ inline const std::size_t Function::hasSignatureId(const std::size_t pSignatureId) const +*/ FORCE_INLINE const std::size_t Function::hasSignatureId(const std::size_t pSignatureId) const { //simple linear-search, efficient for small set of elements. for (const auto& functorId : m_functorIds) { diff --git a/ReflectionTemplateLib/access/inc/Method.h b/ReflectionTemplateLib/access/inc/Method.h index 000df1da..d0452820 100644 --- a/ReflectionTemplateLib/access/inc/Method.h +++ b/ReflectionTemplateLib/access/inc/Method.h @@ -64,10 +64,10 @@ namespace rtl { friend detail::CxxReflection; template - friend class detail::DefaultInvoker; + friend struct detail::DefaultInvoker; template - friend class detail::NonConstInvoker; + friend struct detail::NonConstInvoker; public: diff --git a/ReflectionTemplateLib/access/inc/Method.hpp b/ReflectionTemplateLib/access/inc/Method.hpp index 585ae934..dd073743 100644 --- a/ReflectionTemplateLib/access/inc/Method.hpp +++ b/ReflectionTemplateLib/access/inc/Method.hpp @@ -16,16 +16,16 @@ namespace rtl { template - inline const detail::DefaultInvoker<_signature...> Method::bind(const RObject& pTarget) const + FORCE_INLINE const detail::DefaultInvoker<_signature...> Method::bind(const RObject& pTarget) const { - return detail::DefaultInvoker<_signature...>(*this, pTarget); + return detail::DefaultInvoker<_signature...>{ this, &pTarget }; } template - inline const detail::NonConstInvoker<_signature...> Method::bind(constCast&& pTarget) const + FORCE_INLINE const detail::NonConstInvoker<_signature...> Method::bind(constCast&& pTarget) const { - return detail::NonConstInvoker<_signature...>(*this, pTarget.m_target); + return detail::NonConstInvoker<_signature...>{ this, &pTarget.m_target }; } @@ -51,17 +51,17 @@ namespace rtl { switch (getQualifier()) { - case detail::methodQ::None: { - return Function::hasSignature<_args...>(); - } - case detail::methodQ::NonConst: { - using Container = detail::MethodContainer; - return (hasSignatureId(Container::getContainerId()) != -1); - } - case detail::methodQ::Const: { - using Container = detail::MethodContainer; - return (hasSignatureId(Container::getContainerId()) != -1); - } + case detail::methodQ::None: { + return Function::hasSignature<_args...>(); + } + case detail::methodQ::NonConst: { + using Container = detail::MethodContainer; + return (hasSignatureId(Container::getContainerId()) != -1); + } + case detail::methodQ::Const: { + using Container = detail::MethodContainer; + return (hasSignatureId(Container::getContainerId()) != -1); + } } return false; } diff --git a/ReflectionTemplateLib/access/inc/RObject.hpp b/ReflectionTemplateLib/access/inc/RObject.hpp index 619b01a8..73c28b39 100644 --- a/ReflectionTemplateLib/access/inc/RObject.hpp +++ b/ReflectionTemplateLib/access/inc/RObject.hpp @@ -184,7 +184,7 @@ namespace rtl { return traits::Cloner::template forwardCall(pClonerIndex, alloc::Heap, pClonerIndex, *this); } - return { error::CloningDisabled, RObject() }; + return { error::CloningDisabled, RObject{} }; } @@ -196,7 +196,7 @@ namespace rtl { return traits::Cloner::template forwardCall(pClonerIndex, alloc::Stack, pClonerIndex, *this); } - return { error::CloningDisabled, RObject() }; + return { error::CloningDisabled, RObject{} }; } diff --git a/ReflectionTemplateLib/detail/inc/MethodInvoker.h b/ReflectionTemplateLib/detail/inc/MethodInvoker.h index 3ed505aa..1cd1d1d4 100644 --- a/ReflectionTemplateLib/detail/inc/MethodInvoker.h +++ b/ReflectionTemplateLib/detail/inc/MethodInvoker.h @@ -20,15 +20,13 @@ namespace rtl { namespace rtl::detail { template - class DefaultInvoker + struct DefaultInvoker { //the method to be called. - const Method& m_method; + const Method* m_method; //the object on which, the method needs to be called. - const RObject& m_target; - - DefaultInvoker(const Method& pMethod, const RObject& pTarget); + const RObject* m_target; template struct Invoker { @@ -47,15 +45,13 @@ namespace rtl::detail { template - class NonConstInvoker + struct NonConstInvoker { //the method to be called. - const Method& m_method; + const Method* m_method; //the object on which, the method needs to be called. - const RObject& m_target; - - NonConstInvoker(const Method& pMethod, const RObject& pTarget); + const RObject* m_target; template struct Invoker { diff --git a/ReflectionTemplateLib/detail/inc/MethodInvoker.hpp b/ReflectionTemplateLib/detail/inc/MethodInvoker.hpp index 6e0f946b..c3e8155a 100644 --- a/ReflectionTemplateLib/detail/inc/MethodInvoker.hpp +++ b/ReflectionTemplateLib/detail/inc/MethodInvoker.hpp @@ -18,40 +18,35 @@ namespace rtl::detail { - //DefaultInvoker, holds const-ref of the 'Method' and 'RObject' on which it will be invoked. - template - inline DefaultInvoker<_signature...>::DefaultInvoker(const Method& pMethod, const RObject& pTarget) - : m_method(pMethod) - , m_target(pTarget) { - } - - /* @method: call() @params: params... (corresponding to functor associated with 'm_method') @return: RObject, indicating success of the reflected call. * invokes non-static-member-function functor associated with 'm_method' on object 'm_target'. */ template template - inline Return DefaultInvoker<_signature...>::call(_args&& ...params) const noexcept + FORCE_INLINE Return DefaultInvoker<_signature...>::call(_args&& ...params) const noexcept { //Only static-member-functions have Qualifier- 'methodQ::None' - if (m_method.getQualifier() == methodQ::None) { - return static_cast(m_method).bind().call(std::forward<_args>(params)...); + if (m_method->getQualifier() == methodQ::None) [[unlikely]] { + return static_cast(*m_method).bind().call(std::forward<_args>(params)...); } - if (m_target.isEmpty()) { + else if (m_target->isEmpty()) [[unlikely]] { //if the target is empty. - return { error::EmptyRObject, RObject{ } }; + return { error::EmptyRObject, RObject{} }; } - if (m_target.getTypeId() != m_method.getRecordTypeId()) { + else if (m_target->getTypeId() != m_method->getRecordTypeId()) [[unlikely]] { //if the m_target's type-id & type-id of the 'class/struct' owner of the associated functor(m_method's) do not match. - return { error::TargetMismatch, RObject{ } }; - } - if constexpr (sizeof...(_signature) == 0) { - // executes when bind doesn't have any explicit signature types specified. (e.g. perfect-forwaring) - return Invoker...>::invoke(m_method, m_target, std::forward<_args>(params)...); + return { error::TargetMismatch, RObject{} }; } - else { - return Invoker<_signature...>::invoke(m_method, m_target, std::forward<_args>(params)...); + else [[likely]] + { + if constexpr (sizeof...(_signature) == 0) { + // executes when bind doesn't have any explicit signature types specified. (e.g. perfect-forwaring) + return Invoker...>::invoke(*m_method, *m_target, std::forward<_args>(params)...); + } + else { + return Invoker<_signature...>::invoke(*m_method, *m_target, std::forward<_args>(params)...); + } } } @@ -60,7 +55,7 @@ namespace rtl::detail template template template - inline Return + FORCE_INLINE Return DefaultInvoker<_signature...>::Invoker<_invokSignature...>::invoke(const Method& pMethod, const RObject& pTarget, _args&&... params) @@ -68,7 +63,7 @@ namespace rtl::detail using containerConst = detail::MethodContainer; std::size_t constMethodIndex = pMethod.hasSignatureId(containerConst::getContainerId()); - if (constMethodIndex != rtl::index_none) + if (constMethodIndex != rtl::index_none) [[likely]] { return containerConst::template forwardCall<_args...>(pTarget, constMethodIndex, std::forward<_args>(params)...); } @@ -92,38 +87,33 @@ namespace rtl::detail namespace rtl::detail { - //NonConstInvoker, holds const-ref of the 'Method' and 'RObject' on which it will be invoked. - template - inline NonConstInvoker<_signature...>::NonConstInvoker(const Method& pMethod, const RObject& pTarget) - : m_method(pMethod) - , m_target(pTarget) { - } - - /* @method: call() @params: params... (corresponding to functor associated with 'm_method') @return: RObject, indicating success of the reflected call. * invokes non-static-member-function functor associated with 'm_method' on object 'm_target'. */ template template - inline Return NonConstInvoker<_signature...>::call(_args&& ...params) const noexcept + FORCE_INLINE Return NonConstInvoker<_signature...>::call(_args&& ...params) const noexcept { - if (m_method.getQualifier() == methodQ::None) { - return static_cast(m_method).bind().call(std::forward<_args>(params)...); + if (m_method->getQualifier() == methodQ::None) [[unlikely]] { + return static_cast(*m_method).bind().call(std::forward<_args>(params)...); } - if (m_target.isEmpty()) { + else if (m_target->isEmpty()) [[unlikely]] { //if the target is empty. return { error::EmptyRObject, RObject{} }; } - if (m_target.getTypeId() != m_method.getRecordTypeId()) { + else if (m_target->getTypeId() != m_method->getRecordTypeId()) [[unlikely]] { //if the m_target's type-id & type-id of the 'class/struct' owner of the associated functor(m_method's) do not match. return { error::TargetMismatch, RObject{} }; } - if constexpr (sizeof...(_signature) == 0) { - return Invoker...>::invoke(m_method, m_target, std::forward<_args>(params)...); - } - else { - return Invoker<_signature...>::invoke(m_method, m_target, std::forward<_args>(params)...); + else [[likely]] + { + if constexpr (sizeof...(_signature) == 0) { + return Invoker...>::invoke(*m_method, *m_target, std::forward<_args>(params)...); + } + else { + return Invoker<_signature...>::invoke(*m_method, *m_target, std::forward<_args>(params)...); + } } } @@ -132,14 +122,14 @@ namespace rtl::detail template template template - inline Return + FORCE_INLINE Return NonConstInvoker<_signature...>::Invoker<_invokSignature...>::invoke(const Method& pMethod, const RObject& pTarget, _args&&... params) { using container0 = detail::MethodContainer; const std::size_t index = pMethod.hasSignatureId(container0::getContainerId()); - if (index != rtl::index_none) { + if (index != rtl::index_none) [[likely]] { return container0::template forwardCall<_args...>(pTarget, index, std::forward<_args>(params)...); } else From 9d3e40300b5bd5e2afbc8543a10800b00e52c7f1 Mon Sep 17 00:00:00 2001 From: neeraj Date: Wed, 10 Sep 2025 20:58:32 +0530 Subject: [PATCH 4/6] furthur refinement, bench-mark refactored. --- RTLBenchmarkApp/CMakeLists.txt | 8 +- RTLBenchmarkApp/src/BenchMark.cpp | 179 +++--------------- RTLBenchmarkApp/src/BenchMark.h | 93 ++------- RTLBenchmarkApp/src/ReflectedCall.cpp | 105 ++++++++++ RTLBenchmarkApp/src/ReflectedCall.h | 14 ++ RTLBenchmarkApp/src/StandardCall.cpp | 115 +++++++++++ RTLBenchmarkApp/src/StandardCall.h | 22 +++ RTLBenchmarkApp/src/main.cpp | 28 ++- ReflectionTemplateLib/access/inc/Function.hpp | 2 +- ReflectionTemplateLib/access/inc/RObject.h | 6 +- ReflectionTemplateLib/access/inc/RObject.hpp | 18 +- .../detail/inc/FunctionCaller.h | 6 +- .../detail/inc/FunctionCaller.hpp | 10 +- .../detail/inc/RObjExtracter.h | 54 +++--- .../detail/inc/SetupMethod.hpp | 10 +- 15 files changed, 369 insertions(+), 301 deletions(-) create mode 100644 RTLBenchmarkApp/src/ReflectedCall.cpp create mode 100644 RTLBenchmarkApp/src/ReflectedCall.h create mode 100644 RTLBenchmarkApp/src/StandardCall.cpp create mode 100644 RTLBenchmarkApp/src/StandardCall.h diff --git a/RTLBenchmarkApp/CMakeLists.txt b/RTLBenchmarkApp/CMakeLists.txt index 3d13536a..09787fa5 100644 --- a/RTLBenchmarkApp/CMakeLists.txt +++ b/RTLBenchmarkApp/CMakeLists.txt @@ -46,8 +46,12 @@ set(CXX_EXE_NAME RTLBenchmarkApp) # =============================== add_executable(${CXX_EXE_NAME} src/main.cpp - src/BenchMark.cpp # <-- added - src/BenchMark.h # <-- optional (for IDE visibility) + src/BenchMark.h + src/BenchMark.cpp + src/StandardCall.h + src/StandardCall.cpp + src/ReflectedCall.h + src/ReflectedCall.cpp ) diff --git a/RTLBenchmarkApp/src/BenchMark.cpp b/RTLBenchmarkApp/src/BenchMark.cpp index 7ef71f17..f35a50ad 100644 --- a/RTLBenchmarkApp/src/BenchMark.cpp +++ b/RTLBenchmarkApp/src/BenchMark.cpp @@ -6,182 +6,53 @@ #include "BenchMark.h" -namespace { +extern std::size_t g_work_load_scale; - static const char* LONG_STR = "Lorem ipsum"; - // dolor sit amet, consectetur adipiscing elit, sed do" - // "do aeiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis" - // "nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure" - // "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Except" - // "eur ssint occaecat cupidatat nnon proident, sunt in culpa qui officia deserunt mollit anim id" - // "Lorem ipsum dolor sit amet laboris nisi ut aliquip ex ea commodo"; -} - -// Pre-created string to isolate call overhead -argStr_t g_longStr(LONG_STR); - -extern decltype(&rtl_bench::getMessage) getMessagePtr; -extern decltype(&rtl_bench::sendMessage) sendMessagePtr; -extern decltype(&rtl_bench::Node::getMessage) getMessageNodePtr; -extern decltype(&rtl_bench::Node::sendMessage) sendMessageNodePtr; - -namespace rtl_bench +namespace { - static Node* node = new Node(); - - void BenchMark::directCall_noReturn(benchmark::State& state) - { - for (auto _ : state) - { - sendMessagePtr(g_longStr); - benchmark::DoNotOptimize(g_msg); - } - } - - - void BenchMark::stdFunctionCall_noReturn(benchmark::State& state) - { - static std::function sendMsg = [](argStr_t& pMsg) { - sendMessagePtr(pMsg); - }; - - for (auto _ : state) - { - sendMsg(g_longStr); - benchmark::DoNotOptimize(g_msg); - } - } - - void BenchMark::stdFunctionMethodCall_noReturn(benchmark::State& state) + static void work_load(bm::argStr_t& pMsg) { - static std::function sendMsg = [=](argStr_t& pMsg) { - (node->*sendMessageNodePtr)(pMsg); - }; - - for (auto _ : state) + bm::g_msg = std::string(); + for(int i = 0; i < g_work_load_scale; ++i) { - sendMsg(g_longStr); - benchmark::DoNotOptimize(g_msg); - } - } - - - void BenchMark::directCall_withReturn(benchmark::State& state) - { - static auto _ = []() { - std::cout << "--------------------------------------------------" - "-----------------------------------------------" << std::endl; - return 0; - }(); - - for (auto _ : state) - { - benchmark::DoNotOptimize(getMessage(g_longStr)); - } - } - - - void BenchMark::stdFunctionCall_withReturn(benchmark::State& state) - { - static std::function getMsg = [](argStr_t& pMsg) { - return getMessagePtr(pMsg); - }; - - for (auto _ : state) - { - benchmark::DoNotOptimize(getMsg(g_longStr)); - } - } - - - void BenchMark::stdFunctionMethodCall_withReturn(benchmark::State& state) - { - static std::function getMsg = [=](argStr_t& pMsg) { - return (node->*getMessageNodePtr)(pMsg); - }; - - for (auto _ : state) - { - benchmark::DoNotOptimize(getMsg(g_longStr)); + bm::g_msg->append(pMsg); } } } -namespace rtl_bench +namespace bm { - void BenchMark::reflectedCall_noReturn(benchmark::State& state) + NOINLINE void sendMessage(argStr_t pMsg) { - static rtl::Function sendMsg = cxx_mirror().getFunction("sendMessage").value(); - static auto _ = []() { - auto err = sendMsg.bind().call(g_longStr).err; - if (err != rtl::error::None) { - std::cout << "[rtl:0] err: "<< rtl::to_string(err)<<"\n"; - } - return 0; - }(); - - for (auto _ : state) - { - benchmark::DoNotOptimize(sendMsg.bind().call(g_longStr)); - } + volatile auto* p = &pMsg; + static_cast(p); + work_load(pMsg); } - void BenchMark::reflectedMethodCall_noReturn(benchmark::State& state) + NOINLINE retStr_t getMessage(argStr_t pMsg) { - static rtl::Record rNode = cxx_mirror().getRecord("Node").value(); - static rtl::Method sendMsg = rNode.getMethod("sendMessage").value(); - static rtl::RObject robj = rNode.create().rObject; - static auto _ = []() { - auto err = sendMsg.bind(robj).call(g_longStr).err; - if (err != rtl::error::None) { - std::cout << "[rtl:1] err: " << rtl::to_string(err) << "\n"; - } - return 0; - }(); - - for (auto _ : state) - { - benchmark::DoNotOptimize(sendMsg.bind(robj).call(g_longStr)); - } + volatile auto* p = &pMsg; + static_cast(p); + work_load(pMsg); + return bm::retStr_t(bm::g_msg->c_str()); } - void BenchMark::reflectedCall_withReturn(benchmark::State& state) + NOINLINE void Node::sendMessage(argStr_t pMsg) { - static rtl::Function getMsg = cxx_mirror().getFunction("getMessage").value(); - static auto _ = []() { - auto err = getMsg.bind().call(g_longStr).err; - if (err != rtl::error::None) { - std::cout << "[rtl:2] err: " << rtl::to_string(err) << "\n"; - } - return 0; - }(); - - for (auto _ : state) - { - benchmark::DoNotOptimize(getMsg.bind().call(g_longStr)); - } + volatile auto* p = &pMsg; + static_cast(p); + work_load(pMsg); } - void BenchMark::reflectedMethodCall_withReturn(benchmark::State& state) + NOINLINE retStr_t Node::getMessage(argStr_t pMsg) { - static rtl::Record rNode = cxx_mirror().getRecord("Node").value(); - static rtl::Method getMsg = rNode.getMethod("getMessage").value(); - static rtl::RObject robj = rNode.create().rObject; - static auto _ = []() { - auto err = getMsg.bind(robj).call(g_longStr).err; - if (err != rtl::error::None) { - std::cout << "[rtl:3] err: " << rtl::to_string(err) << "\n"; - } - return 0; - }(); - - for (auto _ : state) - { - benchmark::DoNotOptimize(getMsg.bind(robj).call(g_longStr)); - } + volatile auto* p = &pMsg; + static_cast(p); + work_load(pMsg); + return bm::retStr_t(bm::g_msg->c_str()); } } \ No newline at end of file diff --git a/RTLBenchmarkApp/src/BenchMark.h b/RTLBenchmarkApp/src/BenchMark.h index af96d10a..b706e1e8 100644 --- a/RTLBenchmarkApp/src/BenchMark.h +++ b/RTLBenchmarkApp/src/BenchMark.h @@ -2,9 +2,9 @@ #include -#include - -#include "RTLibInterface.h" +#include +#include +#include #if defined(_MSC_VER) # define NOINLINE __declspec(noinline) @@ -14,79 +14,28 @@ # define NOINLINE #endif -using argStr_t = std::string_view; -using retStr_t = std::string_view; - -#define WORK_LOAD(S) (std::string(S)) - -namespace rtl_bench +namespace bm { - static std::optional g_msg; - - NOINLINE static void sendMessage(argStr_t pMsg) - { - g_msg = WORK_LOAD(pMsg); - } - - NOINLINE static retStr_t getMessage(argStr_t pMsg) - { - g_msg = WORK_LOAD(pMsg); - return retStr_t(g_msg->c_str()); - } + using argStr_t = std::string_view; + using retStr_t = std::string_view; + + static const char* LONG_STR = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do" + "do aeiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis" + "nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure" + "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Except" + "eur ssint occaecat cupidatat nnon proident, sunt in culpa qui officia deserunt mollit anim id" + "Lorem ipsum dolor sit amet laboris nisi ut aliquip ex ea commodo"; + + static argStr_t g_longStr(LONG_STR); struct Node { - NOINLINE void sendMessage(argStr_t pMsg) - { - g_msg = WORK_LOAD(pMsg); - } - - NOINLINE retStr_t getMessage(argStr_t pMsg) - { - g_msg = WORK_LOAD(pMsg); - return retStr_t(g_msg->c_str()); - } + void sendMessage(argStr_t); + retStr_t getMessage(argStr_t); }; + extern void sendMessage(argStr_t); + extern retStr_t getMessage(argStr_t); - static const rtl::CxxMirror& cxx_mirror() - { - static auto m = rtl::CxxMirror({ - - rtl::type().record("Node").build(), - - rtl::type().function("sendMessage").build(sendMessage), - - rtl::type().member().method("sendMessage").build(&Node::sendMessage), - - rtl::type().function("getMessage").build(getMessage), - - rtl::type().member().method("getMessage").build(&Node::getMessage) - }); - return m; - } - - - struct BenchMark - { - static void directCall_noReturn(benchmark::State& state); - - static void stdFunctionCall_noReturn(benchmark::State& state); - - static void reflectedCall_noReturn(benchmark::State& state); - - static void stdFunctionMethodCall_noReturn(benchmark::State& state); - - static void reflectedMethodCall_noReturn(benchmark::State& state); - - static void directCall_withReturn(benchmark::State& state); - - static void stdFunctionCall_withReturn(benchmark::State& state); - - static void stdFunctionMethodCall_withReturn(benchmark::State& state); - - static void reflectedCall_withReturn(benchmark::State& state); - - static void reflectedMethodCall_withReturn(benchmark::State& state); - }; -} + static std::optional g_msg; +} \ No newline at end of file diff --git a/RTLBenchmarkApp/src/ReflectedCall.cpp b/RTLBenchmarkApp/src/ReflectedCall.cpp new file mode 100644 index 00000000..b18daa81 --- /dev/null +++ b/RTLBenchmarkApp/src/ReflectedCall.cpp @@ -0,0 +1,105 @@ +#include "ReflectedCall.h" + +#include "RTLibInterface.h" + +namespace +{ + static const rtl::CxxMirror& cxx_mirror() + { + static auto m = rtl::CxxMirror({ + + rtl::type().function("getMessage").build(bm::getMessage), + + rtl::type().function("sendMessage").build(bm::sendMessage), + + rtl::type().record("Node").build(), + + rtl::type().member().method("sendMessage").build(&bm::Node::sendMessage), + + rtl::type().member().method("getMessage").build(&bm::Node::getMessage) + }); + return m; + } + + static rtl::Record rNode = cxx_mirror().getRecord("Node").value(); + + static rtl::RObject robj = rNode.create().rObject; + + static rtl::Method getMsgMethod = rNode.getMethod("getMessage").value(); + + static rtl::Method sendMsgMethod = rNode.getMethod("sendMessage").value(); + + static rtl::Function getMsg = cxx_mirror().getFunction("getMessage").value(); + + static rtl::Function sendMsg = cxx_mirror().getFunction("sendMessage").value(); +} + + +void ReflectedCall::noReturn(benchmark::State& state) +{ + static auto _ = []() { + auto err = sendMsg.bind().call(bm::g_longStr).err; + if (err != rtl::error::None) { + std::cout << "[0] err: "<< rtl::to_string(err)<<"\n"; + } + return 0; + }(); + + for (auto _ : state) + { + benchmark::DoNotOptimize(sendMsg.bind().call(bm::g_longStr)); + } +} + + +void ReflectedCall::noReturnMethod(benchmark::State& state) +{ + + static auto _ = []() { + auto err = sendMsgMethod.bind(robj).call(bm::g_longStr).err; + if (err != rtl::error::None) { + std::cout << "[1] err: " << rtl::to_string(err) << "\n"; + } + return 0; + }(); + + for (auto _ : state) + { + benchmark::DoNotOptimize(sendMsgMethod.bind(robj).call(bm::g_longStr)); + } +} + + +void ReflectedCall::withReturn(benchmark::State& state) +{ + static rtl::Function getMsg = cxx_mirror().getFunction("getMessage").value(); + static auto _ = []() { + auto err = getMsg.bind().call(bm::g_longStr).err; + if (err != rtl::error::None) { + std::cout << "[2] err: " << rtl::to_string(err) << "\n"; + } + return 0; + }(); + + for (auto _ : state) + { + benchmark::DoNotOptimize(getMsg.bind().call(bm::g_longStr)); + } +} + + +void ReflectedCall::withReturnMethod(benchmark::State& state) +{ + static auto _ = []() { + auto err = getMsgMethod.bind(robj).call(bm::g_longStr).err; + if (err != rtl::error::None) { + std::cout << "[3] err: " << rtl::to_string(err) << "\n"; + } + return 0; + }(); + + for (auto _ : state) + { + benchmark::DoNotOptimize(getMsgMethod.bind(robj).call(bm::g_longStr)); + } +} \ No newline at end of file diff --git a/RTLBenchmarkApp/src/ReflectedCall.h b/RTLBenchmarkApp/src/ReflectedCall.h new file mode 100644 index 00000000..78b4aeaf --- /dev/null +++ b/RTLBenchmarkApp/src/ReflectedCall.h @@ -0,0 +1,14 @@ +#pragma once + +#include "BenchMark.h" + +struct ReflectedCall +{ + static void noReturn(benchmark::State& state); + + static void noReturnMethod(benchmark::State& state); + + static void withReturn(benchmark::State& state); + + static void withReturnMethod(benchmark::State& state); +}; diff --git a/RTLBenchmarkApp/src/StandardCall.cpp b/RTLBenchmarkApp/src/StandardCall.cpp new file mode 100644 index 00000000..e1388e0b --- /dev/null +++ b/RTLBenchmarkApp/src/StandardCall.cpp @@ -0,0 +1,115 @@ + +#include +#include +#include "StandardCall.h" + +namespace +{ + static bm::Node node; + + static std::function sendMsg = [](bm::argStr_t& pMsg) + { + volatile auto* p = &pMsg; + static_cast(p); + bm::sendMessage(pMsg); + }; + + static std::function sendMsgMethod = [](bm::argStr_t& pMsg) + { + volatile auto* p = &pMsg; + static_cast(p); + node.sendMessage(pMsg); + }; + + static std::function getMsg = [](bm::argStr_t& pMsg) + { + { + volatile auto* p = &pMsg; + static_cast(p); + } + const auto& retMsg = bm::getMessage(pMsg); + { + volatile auto* p = &retMsg; + static_cast(p); + } + return retMsg; + }; + + static std::function getMsgMethod = [](bm::argStr_t& pMsg) + { + { + volatile auto* p = &pMsg; + static_cast(p); + } + const auto& retMsg = node.getMessage(pMsg); + { + volatile auto* p = &retMsg; + static_cast(p); + } + return retMsg; + }; +} + + +void DirectCall::noReturn(benchmark::State& state) +{ + for (auto _ : state) + { + bm::sendMessage(bm::g_longStr); + benchmark::DoNotOptimize(bm::g_msg); + } +} + + +void DirectCall::withReturn(benchmark::State& state) +{ + static auto _ = []() { + std::cout << "--------------------------------------" + "--------------------------------------" << std::endl; + return 0; + }(); + + for (auto _ : state) + { + benchmark::DoNotOptimize(bm::getMessage(bm::g_longStr)); + } +} + + + +void StdFunctionCall::noReturn(benchmark::State& state) +{ + for (auto _ : state) + { + sendMsg(bm::g_longStr); + benchmark::DoNotOptimize(bm::g_msg); + } +} + + +void StdFunctionCall::noReturnMethod(benchmark::State& state) +{ + for (auto _ : state) + { + sendMsgMethod(bm::g_longStr); + benchmark::DoNotOptimize(bm::g_msg); + } +} + + +void StdFunctionCall::withReturn(benchmark::State& state) +{ + for (auto _ : state) + { + benchmark::DoNotOptimize(getMsg(bm::g_longStr)); + } +} + + +void StdFunctionCall::withReturnMethod(benchmark::State& state) +{ + for (auto _ : state) + { + benchmark::DoNotOptimize(getMsgMethod(bm::g_longStr)); + } +} \ No newline at end of file diff --git a/RTLBenchmarkApp/src/StandardCall.h b/RTLBenchmarkApp/src/StandardCall.h new file mode 100644 index 00000000..94bb757a --- /dev/null +++ b/RTLBenchmarkApp/src/StandardCall.h @@ -0,0 +1,22 @@ +#pragma once + +#include "BenchMark.h" + +struct DirectCall +{ + static void noReturn(benchmark::State& state); + + static void withReturn(benchmark::State& state); +}; + + +struct StdFunctionCall +{ + static void noReturn(benchmark::State& state); + + static void noReturnMethod(benchmark::State& state); + + static void withReturn(benchmark::State& state); + + static void withReturnMethod(benchmark::State& state); +}; \ No newline at end of file diff --git a/RTLBenchmarkApp/src/main.cpp b/RTLBenchmarkApp/src/main.cpp index 19a2a414..adc4f076 100644 --- a/RTLBenchmarkApp/src/main.cpp +++ b/RTLBenchmarkApp/src/main.cpp @@ -2,23 +2,21 @@ #include #include -#include "BenchMark.h" +#include "StandardCall.h" +#include "ReflectedCall.h" -auto sendMessagePtr = rtl_bench::sendMessage; -auto getMessagePtr = rtl_bench::getMessage; -auto sendMessageNodePtr = &rtl_bench::Node::sendMessage; -auto getMessageNodePtr = &rtl_bench::Node::getMessage; +std::size_t g_work_load_scale = 1; -BENCHMARK(rtl_bench::BenchMark::directCall_noReturn); -BENCHMARK(rtl_bench::BenchMark::stdFunctionCall_noReturn); -BENCHMARK(rtl_bench::BenchMark::stdFunctionMethodCall_noReturn); -BENCHMARK(rtl_bench::BenchMark::reflectedCall_noReturn); -BENCHMARK(rtl_bench::BenchMark::reflectedMethodCall_noReturn); +BENCHMARK(DirectCall::noReturn); +BENCHMARK(StdFunctionCall::noReturn); +BENCHMARK(StdFunctionCall::noReturnMethod); +BENCHMARK(ReflectedCall::noReturn); +BENCHMARK(ReflectedCall::noReturnMethod); -BENCHMARK(rtl_bench::BenchMark::directCall_withReturn); -BENCHMARK(rtl_bench::BenchMark::stdFunctionCall_withReturn); -BENCHMARK(rtl_bench::BenchMark::stdFunctionMethodCall_withReturn); -BENCHMARK(rtl_bench::BenchMark::reflectedCall_withReturn); -BENCHMARK(rtl_bench::BenchMark::reflectedMethodCall_withReturn); +BENCHMARK(DirectCall::withReturn); +BENCHMARK(StdFunctionCall::withReturn); +BENCHMARK(StdFunctionCall::withReturnMethod); +BENCHMARK(ReflectedCall::withReturn); +BENCHMARK(ReflectedCall::withReturnMethod); BENCHMARK_MAIN(); \ No newline at end of file diff --git a/ReflectionTemplateLib/access/inc/Function.hpp b/ReflectionTemplateLib/access/inc/Function.hpp index c4d6e178..69d263c7 100644 --- a/ReflectionTemplateLib/access/inc/Function.hpp +++ b/ReflectionTemplateLib/access/inc/Function.hpp @@ -19,7 +19,7 @@ namespace rtl template inline const detail::FunctionCaller<_signature...> Function::bind() const { - return detail::FunctionCaller<_signature...>(*this); + return detail::FunctionCaller<_signature...>{ this }; } /* @method: hasSignature<...>() diff --git a/ReflectionTemplateLib/access/inc/RObject.h b/ReflectionTemplateLib/access/inc/RObject.h index 9685be6f..d0687119 100644 --- a/ReflectionTemplateLib/access/inc/RObject.h +++ b/ReflectionTemplateLib/access/inc/RObject.h @@ -84,13 +84,13 @@ namespace rtl Return clone() const; template, int> = 0> - std::optional> view() const; + std::optional> view() const noexcept; template, int> = 0> - std::optional> view() const; + std::optional> view() const noexcept; template, int> = 0> - std::optional> view() const; + std::optional> view() const noexcept; static std::atomic& getInstanceCounter(); diff --git a/ReflectionTemplateLib/access/inc/RObject.hpp b/ReflectionTemplateLib/access/inc/RObject.hpp index 73c28b39..cb53c867 100644 --- a/ReflectionTemplateLib/access/inc/RObject.hpp +++ b/ReflectionTemplateLib/access/inc/RObject.hpp @@ -103,7 +103,7 @@ namespace rtl template , int>> - FORCE_INLINE std::optional> RObject::view() const + FORCE_INLINE std::optional> RObject::view() const noexcept { if (isEmpty()) { return std::nullopt; @@ -111,10 +111,10 @@ namespace rtl if constexpr (traits::is_bare_type()) { - if (detail::TypeId::get() == m_objectId.m_wrapperTypeId) + if (detail::TypeId::get() == m_objectId.m_wrapperTypeId) [[likely]] { using U = detail::RObjectUPtr::value_type>; - const U& uptrRef = *(detail::RObjExtractor(this).getWrapper()); + const U& uptrRef = *(detail::RObjExtractor{ this }.getWrapper()); return std::optional>(std::in_place, static_cast(uptrRef)); } } @@ -123,7 +123,7 @@ namespace rtl template , int>> - FORCE_INLINE std::optional> RObject::view() const + FORCE_INLINE std::optional> RObject::view() const noexcept { if (isEmpty()) { return std::nullopt; @@ -131,9 +131,9 @@ namespace rtl if constexpr (traits::is_bare_type()) { - if (detail::TypeId::get() == m_objectId.m_wrapperTypeId) + if (detail::TypeId::get() == m_objectId.m_wrapperTypeId) [[likely]] { - const T* sptrRef = detail::RObjExtractor(this).getWrapper(); + const T* sptrRef = detail::RObjExtractor{ this }.getWrapper(); if (sptrRef != nullptr) { return std::optional>(std::in_place, const_cast(*sptrRef)); } @@ -144,7 +144,7 @@ namespace rtl template , int>> - FORCE_INLINE std::optional> RObject::view() const + FORCE_INLINE std::optional> RObject::view() const noexcept { if (isEmpty()) { return std::nullopt; @@ -153,9 +153,9 @@ namespace rtl if constexpr (traits::is_bare_type()) { const std::size_t asTypeId = detail::TypeId::get(); - if (asTypeId == m_objectId.m_typeId) + if (asTypeId == m_objectId.m_typeId) [[likely]] { - const T* valRef = detail::RObjExtractor(this).getPointer(); + const T* valRef = detail::RObjExtractor{ this }.getPointer(); if (valRef != nullptr) { return std::optional>(std::in_place, *valRef); } diff --git a/ReflectionTemplateLib/detail/inc/FunctionCaller.h b/ReflectionTemplateLib/detail/inc/FunctionCaller.h index f4d746c5..5c297d66 100644 --- a/ReflectionTemplateLib/detail/inc/FunctionCaller.h +++ b/ReflectionTemplateLib/detail/inc/FunctionCaller.h @@ -21,12 +21,10 @@ namespace rtl namespace rtl::detail { template - class FunctionCaller + struct FunctionCaller { //the function to be called. - const Function& m_function; - - FunctionCaller(const Function& pFunction); + const Function* m_function; public: diff --git a/ReflectionTemplateLib/detail/inc/FunctionCaller.hpp b/ReflectionTemplateLib/detail/inc/FunctionCaller.hpp index f3b854be..a673afd5 100644 --- a/ReflectionTemplateLib/detail/inc/FunctionCaller.hpp +++ b/ReflectionTemplateLib/detail/inc/FunctionCaller.hpp @@ -18,21 +18,15 @@ namespace rtl::detail { - template - //FunctionCaller, holds only 'Method' associated with a static-member-function. - inline FunctionCaller<_signature...>::FunctionCaller(const Function& pFunction) - :m_function(pFunction) { - } - template template - inline Return FunctionCaller<_signature...>::call(_args&&...params) const + FORCE_INLINE Return FunctionCaller<_signature...>::call(_args&&...params) const { using Container = std::conditional_t...>, FunctorContainer<_signature...>>; - std::size_t index = m_function.hasSignatureId(Container::getContainerId()); + std::size_t index = m_function->hasSignatureId(Container::getContainerId()); if (index != rtl::index_none) [[likely]] { return Container::template forwardCall<_args...>(index, std::forward<_args>(params)...); } diff --git a/ReflectionTemplateLib/detail/inc/RObjExtracter.h b/ReflectionTemplateLib/detail/inc/RObjExtracter.h index 0b5306d7..0a959376 100644 --- a/ReflectionTemplateLib/detail/inc/RObjExtracter.h +++ b/ReflectionTemplateLib/detail/inc/RObjExtracter.h @@ -15,16 +15,14 @@ namespace rtl::detail { - class RObjExtractor + struct RObjExtractor { friend RObject; - const RObject& m_rObj; + const RObject* m_rObj; - RObjExtractor(const RObject* pRObj) : m_rObj(*pRObj) { } - template - FORCE_INLINE static const T* getPointer(const std::any& pObject, const EntityKind pEntityKind) + FORCE_INLINE static const T* getPointer(const std::any& pObject, const EntityKind pEntityKind) noexcept { switch (pEntityKind) { @@ -42,18 +40,18 @@ namespace rtl::detail template - FORCE_INLINE const T* getPointer() const + FORCE_INLINE const T* getPointer() const noexcept { - switch (m_rObj.m_objectId.m_containsAs) + switch (m_rObj->m_objectId.m_containsAs) { case EntityKind::Ref: { - return std::any_cast(m_rObj.m_object.value()); + return std::any_cast(m_rObj->m_object.value()); } case EntityKind::Wrapper: { return getFromWrapper(); } case EntityKind::Value: { - const T& valueRef = std::any_cast(m_rObj.m_object.value()); + const T& valueRef = std::any_cast(m_rObj->m_object.value()); return static_cast(&valueRef); } default: return nullptr; @@ -63,24 +61,24 @@ namespace rtl::detail template = 0> - FORCE_INLINE auto getWrapper() const -> const RObjectUPtr::value_type>* + FORCE_INLINE auto getWrapper() const noexcept -> const RObjectUPtr::value_type>* { - if (m_rObj.m_objectId.m_wrapperType == detail::Wrapper::Unique) + if (m_rObj->m_objectId.m_wrapperType == detail::Wrapper::Unique) { using _T = traits::std_wrapper::value_type; if constexpr (traits::is_const_v<_T>) { - if (m_rObj.m_objectId.m_isWrappingConst) + if (m_rObj->m_objectId.m_isWrappingConst) { using U = detail::RObjectUPtr; - const U& uptrRef = std::any_cast(m_rObj.m_object.value()); + const U& uptrRef = std::any_cast(m_rObj->m_object.value()); return static_cast(&uptrRef); } } else { using U = detail::RObjectUPtr<_T>; - const U& uptrRef = std::any_cast(m_rObj.m_object.value()); + const U& uptrRef = std::any_cast(m_rObj->m_object.value()); return static_cast(&uptrRef); } } @@ -89,23 +87,23 @@ namespace rtl::detail template = 0> - FORCE_INLINE const T* getWrapper() const + FORCE_INLINE const T* getWrapper() const noexcept { - if (m_rObj.m_objectId.m_wrapperType == detail::Wrapper::Shared) + if (m_rObj->m_objectId.m_wrapperType == detail::Wrapper::Shared) { using _T = traits::std_wrapper::value_type; if constexpr (traits::is_const_v<_T>) { - if (m_rObj.m_objectId.m_isWrappingConst) { + if (m_rObj->m_objectId.m_isWrappingConst) { using U = std::shared_ptr; - const U& sptrRef = std::any_cast(m_rObj.m_object.value()); + const U& sptrRef = std::any_cast(m_rObj->m_object.value()); return static_cast(&sptrRef); } } else { using U = std::shared_ptr<_T>; - const U& sptrRef = std::any_cast(m_rObj.m_object.value()); + const U& sptrRef = std::any_cast(m_rObj->m_object.value()); return static_cast(&sptrRef); } } @@ -114,33 +112,33 @@ namespace rtl::detail template - FORCE_INLINE const T* getFromWrapper() const + FORCE_INLINE const T* getFromWrapper() const noexcept { if constexpr (std::is_destructible_v) { - if (m_rObj.m_objectId.m_wrapperType == detail::Wrapper::Unique) + if (m_rObj->m_objectId.m_wrapperType == detail::Wrapper::Unique) { - if (m_rObj.m_objectId.m_isWrappingConst) { + if (m_rObj->m_objectId.m_isWrappingConst) { using U = detail::RObjectUPtr; - const U& uptrRef = std::any_cast(m_rObj.m_object.value()); + const U& uptrRef = std::any_cast(m_rObj->m_object.value()); return static_cast(uptrRef.get()); } else { using U = detail::RObjectUPtr; - const U& uptrRef = std::any_cast(m_rObj.m_object.value()); + const U& uptrRef = std::any_cast(m_rObj->m_object.value()); return static_cast(uptrRef.get()); } } - if (m_rObj.m_objectId.m_wrapperType == detail::Wrapper::Shared) + if (m_rObj->m_objectId.m_wrapperType == detail::Wrapper::Shared) { - if (m_rObj.m_objectId.m_isWrappingConst) { + if (m_rObj->m_objectId.m_isWrappingConst) { using U = std::shared_ptr; - const auto& sptrRef = std::any_cast(m_rObj.m_object.value()); + const auto& sptrRef = std::any_cast(m_rObj->m_object.value()); return static_cast(sptrRef.get()); } else { using U = std::shared_ptr; - const auto& sptrRef = std::any_cast(m_rObj.m_object.value()); + const auto& sptrRef = std::any_cast(m_rObj->m_object.value()); return static_cast(sptrRef.get()); } } diff --git a/ReflectionTemplateLib/detail/inc/SetupMethod.hpp b/ReflectionTemplateLib/detail/inc/SetupMethod.hpp index b7d4d125..24216920 100644 --- a/ReflectionTemplateLib/detail/inc/SetupMethod.hpp +++ b/ReflectionTemplateLib/detail/inc/SetupMethod.hpp @@ -30,7 +30,7 @@ namespace rtl this is stored in _derivedType's (MethodContainer) vector holding lambda's. */ return [=](const RObject& pTargetObj, _signature&&...params)-> Return { - if (!pTargetObj.isConstCastSafe()) { + if (!pTargetObj.isConstCastSafe()) [[unlikely]] { return { error::IllegalConstCast, RObject{} }; } @@ -50,7 +50,7 @@ namespace rtl this is stored in _derivedType's (MethodContainer) vector holding lambda's. */ return [=](const RObject& pTargetObj, _signature&&...params)-> Return { - if (!pTargetObj.isConstCastSafe()) { + if (!pTargetObj.isConstCastSafe()) [[unlikely]] { return { error::IllegalConstCast, RObject{} }; } @@ -112,9 +112,9 @@ namespace rtl //'target' is const and 'pFunctor' is const-member-function. const _recordType& target = pTargetObj.view<_recordType>()->get(); if constexpr (std::is_reference_v<_returnType>) { - /* if the function returns reference, this block will be retained by compiler. - Note: reference to temporary or dangling is not checked here. - */ using _rawRetType = traits::raw_t<_returnType>; + /* if the function returns reference, this block will be retained by compiler. + Note: reference to temporary or dangling is not checked here. + */ using _rawRetType = traits::raw_t<_returnType>; const _rawRetType& retObj = (target.*pFunctor)(std::forward<_signature>(params)...); return { error::None, RObjectBuilder::template From 722db3922459bd48dca679c11be8498e2cda03df Mon Sep 17 00:00:00 2001 From: neeraj Date: Thu, 11 Sep 2025 00:40:55 +0530 Subject: [PATCH 5/6] benchmarking script added. --- BenchMarkReports/BenchMarkReport_arm.md | 154 -- BenchMarkReports/rtl-bm-raw-logs-linux.txt | 693 ------- RTLBenchmarkApp/src/BenchMark.cpp | 31 +- RTLBenchmarkApp/src/BenchMark.h | 7 +- RTLBenchmarkApp/src/ReflectedCall.cpp | 118 +- RTLBenchmarkApp/src/ReflectedCall.h | 12 +- RTLBenchmarkApp/src/StandardCall.cpp | 91 +- RTLBenchmarkApp/src/StandardCall.h | 12 +- RTLBenchmarkApp/src/main.cpp | 44 +- .../benchmark_return_string_view.log | 1655 +++++++++++++++++ run_benchmarks.sh | 32 + 11 files changed, 1873 insertions(+), 976 deletions(-) delete mode 100644 BenchMarkReports/BenchMarkReport_arm.md delete mode 100644 BenchMarkReports/rtl-bm-raw-logs-linux.txt create mode 100644 benchmarks-stat-log/benchmark_return_string_view.log create mode 100755 run_benchmarks.sh diff --git a/BenchMarkReports/BenchMarkReport_arm.md b/BenchMarkReports/BenchMarkReport_arm.md deleted file mode 100644 index 07d9d0e7..00000000 --- a/BenchMarkReports/BenchMarkReport_arm.md +++ /dev/null @@ -1,154 +0,0 @@ -RTL Benchmarking Analysis Report - -Date: 2025-09-08 -Platform: Android tablet running Ubuntu via Turmax VM -CPU: 8 cores @ 1804.8 MHz -VM Environment: Ubuntu inside Turmax app -Load Average During Benchmarks: 3.9–6.9 -Note: CPU scaling enabled; real-time measurements may include slight noise. - - ---- - -1. Benchmark Setup - -All benchmarks measure call dispatch time for various call types under different workloads: - -Direct Call: Native C++ function calls. - -std::function Call: Calls wrapped in std::function. - -std::function Method Call: Member functions wrapped in std::function. - -Reflected Call: RTL reflection free function dispatch. - -Reflected Method Call: RTL reflection method dispatch. - - -Two variants measured: - -No-Return: Functions with void return type. - -With-Return: Functions returning a value. - - -Iterations per benchmark varied depending on workload and time resolution, from millions of iterations at ~100 ns calls to hundreds of thousands at ~1 µs calls. - - ---- - -2. OS & Platform Context - -Android environment running Ubuntu via Turmax VM introduces: - -CPU scheduling variability - -CPU frequency scaling - -Minor memory virtualization overhead - - -Despite this, benchmark results are stable and reproducible, with only small variations across runs (~2–5%). - -Load averages during tests were moderate-to-high (3.9–6.9), confirming RTL performance is robust under system stress. - - - ---- - -3. Benchmark Results Summary - -3.1 No-Return Calls - -Call Type Time Range (ns) Overhead vs Direct - -Direct Call 106–1176 0% -std::function 108–1448 5–23% -std::function Method 113–1247 7–10% -Reflected Call 110–1234 8–10% -Reflected Method 120–1260 10–14% - - -Observations: - -Reflection overhead is modest and predictable. - -Reflected free calls scale well, occasionally slightly cheaper than direct calls due to CPU cache effects. - -Method calls are ~10–14% slower than direct calls at peak workload. - - -3.2 With-Return Calls - -Call Type Time Range (ns) Overhead vs Direct - -Direct Call 133–1292 0% -std::function 135–1296 0–5% -std::function Method 143–1300 0–4% -Reflected Call 177–1345 3–6% -Reflected Method 192–1376 5–10% - - -Observations: - -Return value dispatch adds ~50–80 ns per call consistently. - -Reflected methods with return are the heaviest, but overhead remains bounded below 10%. - -Scaling is linear even at extreme workloads (hundreds of thousands of calls in µs range). - - - ---- - -4. Scaling Insights - -1. Direct and std::function calls scale linearly with workload; predictable performance. - - -2. Reflected calls scale well — overhead remains bounded, even at ultra-heavy call frequencies (~1+ µs/call). - - -3. Methods cost slightly more than free functions (~10%), consistent across workload. - - -4. Return-value functions consistently add ~50–80 ns, regardless of workload. - - -5. Minor run-to-run variation is attributable to VM CPU scheduling and frequency scaling, not RTL inefficiency. - - - - ---- - -5. Implications for RTL Usage - -Dynamic Workloads: Reflection can safely handle millions of calls without becoming a bottleneck. - -Game Engines / Scripting / Tooling: RTL is suitable for runtime event dispatch, editor tooling, and serialization/deserialization tasks. - -Micro-optimization: For extremely hot loops (<10 ns per call), direct calls or std::function may still be preferred. - -Overall: RTL provides a balanced tradeoff between dynamic flexibility and runtime performance. - - - ---- - -6. Conclusion - -RTL reflection overhead is modest and predictable: - -~5–10% for free function reflection - -~10–14% for method reflection - -Return-value adds ~50–80 ns consistently - - -Even in heavy workloads (~1 µs per call), reflection remains viable for high-frequency dynamic systems. - -This confirms RTL’s practicality in real-world applications, including heavy scripting, runtime tools, and editor-driven dynamic systems. - - diff --git a/BenchMarkReports/rtl-bm-raw-logs-linux.txt b/BenchMarkReports/rtl-bm-raw-logs-linux.txt deleted file mode 100644 index 09611905..00000000 --- a/BenchMarkReports/rtl-bm-raw-logs-linux.txt +++ /dev/null @@ -1,693 +0,0 @@ -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 5.13 ns 5.13 ns 135919976 -rtl_bench::BenchMark::stdFunctionCall_noReturn 7.76 ns 7.76 ns 94666728 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 7.25 ns 7.25 ns 95301804 -rtl_bench::BenchMark::reflectedCall_noReturn 8.84 ns 8.84 ns 78729071 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 12.8 ns 12.8 ns 54304726 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 10.9 ns 10.9 ns 64504012 -rtl_bench::BenchMark::stdFunctionCall_withReturn 11.3 ns 11.3 ns 62169837 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 11.3 ns 11.3 ns 62025636 -rtl_bench::BenchMark::reflectedCall_withReturn 19.7 ns 19.7 ns 34449012 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 24.2 ns 24.2 ns 28818816 - - -Run on (16 X 2365.46 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 0.40, 0.22, 0.10 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 5.13 ns 5.13 ns 132976781 -rtl_bench::BenchMark::stdFunctionCall_noReturn 7.67 ns 7.66 ns 89565266 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 7.49 ns 7.49 ns 90664223 -rtl_bench::BenchMark::reflectedCall_noReturn 9.09 ns 9.08 ns 75820200 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 12.9 ns 12.9 ns 52811968 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 11.1 ns 11.1 ns 63236228 -rtl_bench::BenchMark::stdFunctionCall_withReturn 11.3 ns 11.3 ns 62114941 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 11.3 ns 11.3 ns 62173322 -rtl_bench::BenchMark::reflectedCall_withReturn 20.1 ns 20.1 ns 34688477 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 24.4 ns 24.4 ns 28344154 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 0.49, 0.25, 0.11 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 5.12 ns 5.12 ns 135119531 -rtl_bench::BenchMark::stdFunctionCall_noReturn 7.49 ns 7.49 ns 93438823 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 7.38 ns 7.37 ns 89833458 -rtl_bench::BenchMark::reflectedCall_noReturn 8.97 ns 8.96 ns 77159534 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 12.8 ns 12.8 ns 53713548 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 10.9 ns 10.8 ns 64448503 -rtl_bench::BenchMark::stdFunctionCall_withReturn 11.3 ns 11.3 ns 62186623 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 11.3 ns 11.3 ns 61775887 -rtl_bench::BenchMark::reflectedCall_withReturn 21.1 ns 21.1 ns 33369106 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 25.3 ns 25.3 ns 28330205 - - -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 43.5 ns 43.4 ns 16140035 -rtl_bench::BenchMark::stdFunctionCall_noReturn 43.5 ns 43.5 ns 16022738 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 46.4 ns 46.4 ns 15125120 -rtl_bench::BenchMark::reflectedCall_noReturn 45.0 ns 45.0 ns 15619923 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 53.0 ns 53.0 ns 13172672 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 47.2 ns 47.2 ns 14672175 -rtl_bench::BenchMark::stdFunctionCall_withReturn 46.9 ns 46.9 ns 14944416 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 47.9 ns 47.9 ns 13860992 -rtl_bench::BenchMark::reflectedCall_withReturn 59.8 ns 59.8 ns 11560810 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 66.3 ns 66.3 ns 10551881 - - -Run on (16 X 2759.67 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.89, 1.58, 0.71 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 43.3 ns 43.3 ns 16255535 -rtl_bench::BenchMark::stdFunctionCall_noReturn 43.9 ns 43.9 ns 15980619 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 46.9 ns 46.9 ns 15033010 -rtl_bench::BenchMark::reflectedCall_noReturn 44.7 ns 44.7 ns 15594562 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 52.0 ns 52.0 ns 13109978 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 46.0 ns 46.0 ns 15172547 -rtl_bench::BenchMark::stdFunctionCall_withReturn 46.4 ns 46.4 ns 15047246 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 49.5 ns 49.4 ns 14209101 -rtl_bench::BenchMark::reflectedCall_withReturn 60.2 ns 60.2 ns 11739374 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 65.6 ns 65.6 ns 10567973 - - -Run on (16 X 3463.13 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.54, 1.56, 0.72 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 42.7 ns 42.7 ns 16337775 -rtl_bench::BenchMark::stdFunctionCall_noReturn 43.0 ns 43.0 ns 16271330 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 44.7 ns 44.7 ns 15666732 -rtl_bench::BenchMark::reflectedCall_noReturn 44.7 ns 44.7 ns 15661281 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 52.8 ns 52.8 ns 13150690 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 47.5 ns 47.5 ns 14694843 -rtl_bench::BenchMark::stdFunctionCall_withReturn 47.7 ns 47.7 ns 14654741 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 48.0 ns 48.0 ns 14583577 -rtl_bench::BenchMark::reflectedCall_withReturn 59.3 ns 59.2 ns 11665284 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 66.1 ns 66.1 ns 10264640 - - - -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 93.1 ns 93.0 ns 7452049 -rtl_bench::BenchMark::stdFunctionCall_noReturn 85.5 ns 85.5 ns 8160664 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 85.6 ns 85.6 ns 8170267 -rtl_bench::BenchMark::reflectedCall_noReturn 87.3 ns 87.3 ns 8019372 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 96.3 ns 96.3 ns 7320818 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 97.7 ns 97.7 ns 7185010 -rtl_bench::BenchMark::stdFunctionCall_withReturn 97.8 ns 97.8 ns 7143808 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 98.2 ns 98.2 ns 7136742 -rtl_bench::BenchMark::reflectedCall_withReturn 110 ns 110 ns 6331574 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 109 ns 109 ns 6428569 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 1.86, 1.52, 0.81 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 93.0 ns 93.0 ns 7505449 -rtl_bench::BenchMark::stdFunctionCall_noReturn 86.4 ns 86.4 ns 8293576 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 86.0 ns 86.0 ns 7970089 -rtl_bench::BenchMark::reflectedCall_noReturn 86.7 ns 86.7 ns 7903218 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 99.0 ns 99.0 ns 7252173 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 99.1 ns 99.1 ns 7127303 -rtl_bench::BenchMark::stdFunctionCall_withReturn 100 ns 100 ns 7127599 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 96.1 ns 96.1 ns 6960473 -rtl_bench::BenchMark::reflectedCall_withReturn 108 ns 108 ns 6488518 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 110 ns 110 ns 6402141 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 1.65, 1.48, 0.81 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 89.6 ns 89.6 ns 7704175 -rtl_bench::BenchMark::stdFunctionCall_noReturn 84.2 ns 84.2 ns 8221287 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 84.1 ns 84.1 ns 8287490 -rtl_bench::BenchMark::reflectedCall_noReturn 84.5 ns 84.5 ns 8258013 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 96.8 ns 96.8 ns 7220738 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 94.6 ns 94.6 ns 7379540 -rtl_bench::BenchMark::stdFunctionCall_withReturn 94.2 ns 94.2 ns 7376416 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 95.8 ns 95.8 ns 7303837 -rtl_bench::BenchMark::reflectedCall_withReturn 107 ns 107 ns 6513129 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 110 ns 110 ns 6376445 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 3.45, 1.93, 1.05 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 145 ns 145 ns 4777413 -rtl_bench::BenchMark::stdFunctionCall_noReturn 158 ns 158 ns 4431253 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 158 ns 158 ns 4414950 -rtl_bench::BenchMark::reflectedCall_noReturn 150 ns 150 ns 4656282 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 160 ns 160 ns 4374654 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 163 ns 163 ns 4264835 -rtl_bench::BenchMark::stdFunctionCall_withReturn 164 ns 164 ns 4268809 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 165 ns 165 ns 4241611 -rtl_bench::BenchMark::reflectedCall_withReturn 177 ns 177 ns 3955011 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 177 ns 177 ns 3946072 - - -Run on (16 X 2754.8 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 3.08, 1.90, 1.04 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 143 ns 143 ns 4875747 -rtl_bench::BenchMark::stdFunctionCall_noReturn 155 ns 155 ns 4459259 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 156 ns 156 ns 4467358 -rtl_bench::BenchMark::reflectedCall_noReturn 149 ns 149 ns 4693753 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 161 ns 161 ns 4341051 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 161 ns 161 ns 4285692 -rtl_bench::BenchMark::stdFunctionCall_withReturn 162 ns 162 ns 4334995 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 163 ns 163 ns 4318397 -rtl_bench::BenchMark::reflectedCall_withReturn 174 ns 174 ns 4017771 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 178 ns 178 ns 3961999 - - -Run on (16 X 2969.86 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.54, 1.84, 1.04 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 143 ns 143 ns 4764039 -rtl_bench::BenchMark::stdFunctionCall_noReturn 156 ns 156 ns 4469178 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 157 ns 157 ns 4456946 -rtl_bench::BenchMark::reflectedCall_noReturn 150 ns 150 ns 4642233 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 161 ns 161 ns 4333830 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 162 ns 162 ns 4324427 -rtl_bench::BenchMark::stdFunctionCall_withReturn 163 ns 163 ns 4298995 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 163 ns 163 ns 4276257 -rtl_bench::BenchMark::reflectedCall_withReturn 175 ns 175 ns 3993045 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 178 ns 178 ns 3935333 - - -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 333 ns 333 ns 2102913 -rtl_bench::BenchMark::stdFunctionCall_noReturn 321 ns 321 ns 2185634 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 318 ns 318 ns 2240800 -rtl_bench::BenchMark::reflectedCall_noReturn 314 ns 313 ns 2239171 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 318 ns 318 ns 2204379 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 340 ns 340 ns 2073976 -rtl_bench::BenchMark::stdFunctionCall_withReturn 338 ns 338 ns 2077093 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 338 ns 338 ns 2075401 -rtl_bench::BenchMark::reflectedCall_withReturn 341 ns 340 ns 2054536 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 341 ns 341 ns 2044551 - - -Run on (16 X 1745.17 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.10, 1.96, 1.18 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 311 ns 311 ns 2248437 -rtl_bench::BenchMark::stdFunctionCall_noReturn 294 ns 294 ns 2377622 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 295 ns 295 ns 2368740 -rtl_bench::BenchMark::reflectedCall_noReturn 298 ns 297 ns 2359583 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 302 ns 301 ns 2309840 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 316 ns 315 ns 2221511 -rtl_bench::BenchMark::stdFunctionCall_withReturn 315 ns 315 ns 2228403 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 318 ns 318 ns 2210030 -rtl_bench::BenchMark::reflectedCall_withReturn 332 ns 332 ns 2106466 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 333 ns 333 ns 2094067 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 1.93, 1.92, 1.18 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 313 ns 313 ns 2236927 -rtl_bench::BenchMark::stdFunctionCall_noReturn 294 ns 294 ns 2375376 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 296 ns 296 ns 2367683 -rtl_bench::BenchMark::reflectedCall_noReturn 288 ns 288 ns 2435142 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 293 ns 292 ns 2385426 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 306 ns 306 ns 2292899 -rtl_bench::BenchMark::stdFunctionCall_withReturn 308 ns 308 ns 2272770 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 307 ns 307 ns 2285690 -rtl_bench::BenchMark::reflectedCall_withReturn 324 ns 324 ns 2165729 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 329 ns 329 ns 2131439 - - -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 427 ns 426 ns 1640259 -rtl_bench::BenchMark::stdFunctionCall_noReturn 418 ns 418 ns 1673663 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 412 ns 412 ns 1663531 -rtl_bench::BenchMark::reflectedCall_noReturn 403 ns 402 ns 1744466 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 414 ns 414 ns 1694049 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 439 ns 439 ns 1594234 -rtl_bench::BenchMark::stdFunctionCall_withReturn 439 ns 439 ns 1588323 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 442 ns 441 ns 1589325 -rtl_bench::BenchMark::reflectedCall_withReturn 474 ns 474 ns 1473335 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 485 ns 485 ns 1447302 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.62, 2.16, 1.34 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 429 ns 429 ns 1630936 -rtl_bench::BenchMark::stdFunctionCall_noReturn 423 ns 423 ns 1658743 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 415 ns 414 ns 1689553 -rtl_bench::BenchMark::reflectedCall_noReturn 407 ns 406 ns 1716778 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 417 ns 417 ns 1681352 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 445 ns 445 ns 1572865 -rtl_bench::BenchMark::stdFunctionCall_withReturn 447 ns 447 ns 1567737 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 450 ns 450 ns 1555132 -rtl_bench::BenchMark::reflectedCall_withReturn 470 ns 470 ns 1487432 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 467 ns 467 ns 1508687 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.18, 2.08, 1.33 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 426 ns 426 ns 1642497 -rtl_bench::BenchMark::stdFunctionCall_noReturn 426 ns 426 ns 1635642 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 425 ns 425 ns 1648210 -rtl_bench::BenchMark::reflectedCall_noReturn 399 ns 399 ns 1757243 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 409 ns 409 ns 1716411 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 438 ns 438 ns 1598323 -rtl_bench::BenchMark::stdFunctionCall_withReturn 437 ns 437 ns 1602346 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 442 ns 442 ns 1587073 -rtl_bench::BenchMark::reflectedCall_withReturn 458 ns 458 ns 1523923 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 481 ns 481 ns 1456282 - - - - -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 502 ns 502 ns 1371875 -rtl_bench::BenchMark::stdFunctionCall_noReturn 501 ns 501 ns 1369311 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 497 ns 497 ns 1395926 -rtl_bench::BenchMark::reflectedCall_noReturn 496 ns 496 ns 1412410 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 501 ns 501 ns 1000000 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 540 ns 540 ns 1295965 -rtl_bench::BenchMark::stdFunctionCall_withReturn 540 ns 540 ns 1268086 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 551 ns 550 ns 1261480 -rtl_bench::BenchMark::reflectedCall_withReturn 558 ns 558 ns 1263226 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 564 ns 564 ns 1235554 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 3.46, 2.52, 1.55 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 519 ns 519 ns 1341196 -rtl_bench::BenchMark::stdFunctionCall_noReturn 523 ns 523 ns 1340750 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 524 ns 523 ns 1337374 -rtl_bench::BenchMark::reflectedCall_noReturn 517 ns 517 ns 1349960 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 506 ns 506 ns 1377893 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 554 ns 554 ns 1263461 -rtl_bench::BenchMark::stdFunctionCall_withReturn 552 ns 552 ns 1266256 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 566 ns 566 ns 1227643 -rtl_bench::BenchMark::reflectedCall_withReturn 577 ns 577 ns 1215818 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 580 ns 580 ns 1202552 - - -Run on (16 X 2781.79 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 3.09, 2.47, 1.54 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 495 ns 495 ns 1388676 -rtl_bench::BenchMark::stdFunctionCall_noReturn 497 ns 497 ns 1407687 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 497 ns 497 ns 1416107 -rtl_bench::BenchMark::reflectedCall_noReturn 489 ns 489 ns 1430916 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 501 ns 501 ns 1000000 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 535 ns 535 ns 1304378 -rtl_bench::BenchMark::stdFunctionCall_withReturn 530 ns 530 ns 1301609 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 543 ns 543 ns 1278572 -rtl_bench::BenchMark::reflectedCall_withReturn 556 ns 556 ns 1257309 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 557 ns 557 ns 1251417 - - -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 757 ns 757 ns 916685 -rtl_bench::BenchMark::stdFunctionCall_noReturn 829 ns 829 ns 842191 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 827 ns 827 ns 845414 -rtl_bench::BenchMark::reflectedCall_noReturn 837 ns 837 ns 835169 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 823 ns 823 ns 852284 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 860 ns 859 ns 815094 -rtl_bench::BenchMark::stdFunctionCall_withReturn 859 ns 858 ns 815626 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 864 ns 864 ns 810770 -rtl_bench::BenchMark::reflectedCall_withReturn 887 ns 886 ns 789280 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 875 ns 875 ns 798536 - - -Run on (16 X 1945.38 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 3.11, 2.54, 1.66 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 758 ns 757 ns 906520 -rtl_bench::BenchMark::stdFunctionCall_noReturn 791 ns 791 ns 880864 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 780 ns 780 ns 900359 -rtl_bench::BenchMark::reflectedCall_noReturn 799 ns 799 ns 875178 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 804 ns 804 ns 873071 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 834 ns 834 ns 843143 -rtl_bench::BenchMark::stdFunctionCall_withReturn 842 ns 842 ns 832123 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 842 ns 842 ns 828542 -rtl_bench::BenchMark::reflectedCall_withReturn 867 ns 867 ns 804433 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 934 ns 933 ns 748890 - - -Run on (16 X 3246.61 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.87, 2.50, 1.66 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 753 ns 753 ns 918702 -rtl_bench::BenchMark::stdFunctionCall_noReturn 785 ns 785 ns 892075 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 780 ns 780 ns 896138 -rtl_bench::BenchMark::reflectedCall_noReturn 799 ns 799 ns 876522 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 788 ns 788 ns 883587 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 836 ns 836 ns 839415 -rtl_bench::BenchMark::stdFunctionCall_withReturn 838 ns 838 ns 832219 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 841 ns 840 ns 830053 -rtl_bench::BenchMark::reflectedCall_withReturn 849 ns 849 ns 823196 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 916 ns 915 ns 754851 - - - -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 1100 ns 1100 ns 632363 -rtl_bench::BenchMark::stdFunctionCall_noReturn 1054 ns 1054 ns 662974 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 1040 ns 1040 ns 674205 -rtl_bench::BenchMark::reflectedCall_noReturn 1046 ns 1045 ns 670240 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 1070 ns 1070 ns 651628 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 1122 ns 1122 ns 624551 -rtl_bench::BenchMark::stdFunctionCall_withReturn 1133 ns 1132 ns 619889 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 1135 ns 1135 ns 617640 -rtl_bench::BenchMark::reflectedCall_withReturn 1159 ns 1158 ns 602541 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 1156 ns 1156 ns 603317 - - -Run on (16 X 2028.18 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.62, 2.26, 1.67 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 1138 ns 1138 ns 613322 -rtl_bench::BenchMark::stdFunctionCall_noReturn 1101 ns 1101 ns 635065 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 1100 ns 1100 ns 638960 -rtl_bench::BenchMark::reflectedCall_noReturn 1116 ns 1116 ns 626865 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 1116 ns 1116 ns 625500 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 1218 ns 1218 ns 575604 -rtl_bench::BenchMark::stdFunctionCall_withReturn 1210 ns 1210 ns 577096 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 1214 ns 1214 ns 577554 -rtl_bench::BenchMark::reflectedCall_withReturn 1232 ns 1232 ns 567417 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 1256 ns 1256 ns 557420 - - -Run on (16 X 3889.87 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.37, 2.22, 1.66 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 1124 ns 1124 ns 618683 -rtl_bench::BenchMark::stdFunctionCall_noReturn 1087 ns 1087 ns 644721 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 1087 ns 1087 ns 647622 -rtl_bench::BenchMark::reflectedCall_noReturn 1118 ns 1118 ns 626140 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 1077 ns 1077 ns 650312 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 1150 ns 1150 ns 607736 -rtl_bench::BenchMark::stdFunctionCall_withReturn 1150 ns 1149 ns 611164 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 1148 ns 1147 ns 611430 -rtl_bench::BenchMark::reflectedCall_withReturn 1168 ns 1167 ns 599467 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 1210 ns 1209 ns 577476 - - - -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 1792 ns 1792 ns 389736 -rtl_bench::BenchMark::stdFunctionCall_noReturn 1826 ns 1826 ns 382731 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 1824 ns 1823 ns 384223 -rtl_bench::BenchMark::reflectedCall_noReturn 1843 ns 1842 ns 381120 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 1852 ns 1852 ns 378798 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 1906 ns 1906 ns 367308 -rtl_bench::BenchMark::stdFunctionCall_withReturn 1898 ns 1897 ns 369064 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 1886 ns 1886 ns 371488 -rtl_bench::BenchMark::reflectedCall_withReturn 1914 ns 1914 ns 365682 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 1912 ns 1912 ns 366439 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.51, 2.26, 1.72 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 1790 ns 1789 ns 389620 -rtl_bench::BenchMark::stdFunctionCall_noReturn 1799 ns 1798 ns 389231 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 1813 ns 1813 ns 386364 -rtl_bench::BenchMark::reflectedCall_noReturn 1850 ns 1850 ns 378291 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 1859 ns 1858 ns 376985 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 1915 ns 1915 ns 365091 -rtl_bench::BenchMark::stdFunctionCall_withReturn 1906 ns 1906 ns 367659 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 1909 ns 1908 ns 366869 -rtl_bench::BenchMark::reflectedCall_withReturn 1923 ns 1923 ns 364394 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 1939 ns 1939 ns 360718 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 2.28, 2.22, 1.71 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 1794 ns 1794 ns 388550 -rtl_bench::BenchMark::stdFunctionCall_noReturn 1794 ns 1794 ns 390699 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 1816 ns 1815 ns 385694 -rtl_bench::BenchMark::reflectedCall_noReturn 1850 ns 1850 ns 379327 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 1841 ns 1841 ns 380463 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 1906 ns 1906 ns 366691 -rtl_bench::BenchMark::stdFunctionCall_withReturn 1915 ns 1915 ns 364899 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 1915 ns 1915 ns 365671 -rtl_bench::BenchMark::reflectedCall_withReturn 1918 ns 1918 ns 365007 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 1922 ns 1922 ns 363882 - - - -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 2577 ns 2577 ns 271061 -rtl_bench::BenchMark::stdFunctionCall_noReturn 2593 ns 2593 ns 268859 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 2609 ns 2609 ns 268339 -rtl_bench::BenchMark::reflectedCall_noReturn 2696 ns 2696 ns 260166 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 2695 ns 2695 ns 259237 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 2792 ns 2792 ns 250546 -rtl_bench::BenchMark::stdFunctionCall_withReturn 2786 ns 2785 ns 251093 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 2785 ns 2785 ns 251791 -rtl_bench::BenchMark::reflectedCall_withReturn 2814 ns 2813 ns 248843 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 2780 ns 2779 ns 251869 - - -Run on (16 X 4181.03 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 1.51, 1.36, 1.42 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 2583 ns 2583 ns 270337 -rtl_bench::BenchMark::stdFunctionCall_noReturn 2590 ns 2589 ns 269402 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 2605 ns 2605 ns 268387 -rtl_bench::BenchMark::reflectedCall_noReturn 2671 ns 2671 ns 261357 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 2671 ns 2670 ns 261626 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 2763 ns 2763 ns 253027 -rtl_bench::BenchMark::stdFunctionCall_withReturn 2760 ns 2760 ns 253960 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 2767 ns 2767 ns 253570 -rtl_bench::BenchMark::reflectedCall_withReturn 2793 ns 2792 ns 250558 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 2816 ns 2815 ns 247024 - - -Run on (16 X 800 MHz CPU s) -CPU Caches: - L1 Data 48 KiB (x8) - L1 Instruction 32 KiB (x8) - L2 Unified 1280 KiB (x8) - L3 Unified 20480 KiB (x1) -Load Average: 1.03, 1.26, 1.38 -------------------------------------------------------------------------------------------------- -Benchmark Time CPU Iterations -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_noReturn 2591 ns 2591 ns 270477 -rtl_bench::BenchMark::stdFunctionCall_noReturn 2590 ns 2590 ns 269857 -rtl_bench::BenchMark::stdFunctionMethodCall_noReturn 2607 ns 2606 ns 268289 -rtl_bench::BenchMark::reflectedCall_noReturn 2683 ns 2682 ns 260304 -rtl_bench::BenchMark::reflectedMethodCall_noReturn 2710 ns 2709 ns 258250 -------------------------------------------------------------------------------------------------- -rtl_bench::BenchMark::directCall_withReturn 2800 ns 2800 ns 248906 -rtl_bench::BenchMark::stdFunctionCall_withReturn 2795 ns 2794 ns 250415 -rtl_bench::BenchMark::stdFunctionMethodCall_withReturn 2797 ns 2797 ns 249372 -rtl_bench::BenchMark::reflectedCall_withReturn 2804 ns 2803 ns 249544 -rtl_bench::BenchMark::reflectedMethodCall_withReturn 2813 ns 2812 ns 248149 \ No newline at end of file diff --git a/RTLBenchmarkApp/src/BenchMark.cpp b/RTLBenchmarkApp/src/BenchMark.cpp index f35a50ad..db13319e 100644 --- a/RTLBenchmarkApp/src/BenchMark.cpp +++ b/RTLBenchmarkApp/src/BenchMark.cpp @@ -7,16 +7,18 @@ #include "BenchMark.h" extern std::size_t g_work_load_scale; +extern std::optional g_work_done; namespace { - static void work_load(bm::argStr_t& pMsg) + NOINLINE static std::string work_load(bm::argStr_t& pMsg) { - bm::g_msg = std::string(); + auto workStr = std::string(); for(int i = 0; i < g_work_load_scale; ++i) { - bm::g_msg->append(pMsg); + workStr += pMsg; } + return workStr; } } @@ -27,32 +29,33 @@ namespace bm { volatile auto* p = &pMsg; static_cast(p); - work_load(pMsg); + + g_work_done = work_load(pMsg); } - - NOINLINE retStr_t getMessage(argStr_t pMsg) + NOINLINE void Node::sendMessage(argStr_t pMsg) { volatile auto* p = &pMsg; static_cast(p); - work_load(pMsg); - return bm::retStr_t(bm::g_msg->c_str()); - } + g_work_done = work_load(pMsg); + } - NOINLINE void Node::sendMessage(argStr_t pMsg) + NOINLINE retStr_t getMessage(argStr_t pMsg) { volatile auto* p = &pMsg; static_cast(p); - work_load(pMsg); - } + g_work_done = work_load(pMsg); + return bm::retStr_t(g_work_done->c_str()); + } NOINLINE retStr_t Node::getMessage(argStr_t pMsg) { volatile auto* p = &pMsg; static_cast(p); - work_load(pMsg); - return bm::retStr_t(bm::g_msg->c_str()); + + g_work_done = work_load(pMsg); + return bm::retStr_t(g_work_done->c_str()); } } \ No newline at end of file diff --git a/RTLBenchmarkApp/src/BenchMark.h b/RTLBenchmarkApp/src/BenchMark.h index b706e1e8..3dab4135 100644 --- a/RTLBenchmarkApp/src/BenchMark.h +++ b/RTLBenchmarkApp/src/BenchMark.h @@ -19,8 +19,9 @@ namespace bm using argStr_t = std::string_view; using retStr_t = std::string_view; - static const char* LONG_STR = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do" - "do aeiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis" + static const char* LONG_STR = "Lorem ipsum" + "dolor sit amet, consectetur adipiscing elit, sed do" + "do aeiusmod tempor incididunt uth labore et dolore magna aliqua. Ut enim ad minim veniam, quis" "nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure" "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Except" "eur ssint occaecat cupidatat nnon proident, sunt in culpa qui officia deserunt mollit anim id" @@ -36,6 +37,4 @@ namespace bm extern void sendMessage(argStr_t); extern retStr_t getMessage(argStr_t); - - static std::optional g_msg; } \ No newline at end of file diff --git a/RTLBenchmarkApp/src/ReflectedCall.cpp b/RTLBenchmarkApp/src/ReflectedCall.cpp index b18daa81..3864bf68 100644 --- a/RTLBenchmarkApp/src/ReflectedCall.cpp +++ b/RTLBenchmarkApp/src/ReflectedCall.cpp @@ -1,5 +1,5 @@ -#include "ReflectedCall.h" +#include "ReflectedCall.h" #include "RTLibInterface.h" namespace @@ -21,85 +21,105 @@ namespace return m; } - static rtl::Record rNode = cxx_mirror().getRecord("Node").value(); + static rtl::Record Node = cxx_mirror().getRecord("Node").value(); - static rtl::RObject robj = rNode.create().rObject; - - static rtl::Method getMsgMethod = rNode.getMethod("getMessage").value(); + static rtl::RObject robj = Node.create().rObject; - static rtl::Method sendMsgMethod = rNode.getMethod("sendMessage").value(); - - static rtl::Function getMsg = cxx_mirror().getFunction("getMessage").value(); + static rtl::Method NodeGetMessage = Node.getMethod("getMessage").value(); + + static rtl::Method NodeSendMessage = Node.getMethod("sendMessage").value(); + + static rtl::Function GetMessage = cxx_mirror().getFunction("getMessage").value(); - static rtl::Function sendMsg = cxx_mirror().getFunction("sendMessage").value(); + static rtl::Function SendMessage = cxx_mirror().getFunction("sendMessage").value(); } -void ReflectedCall::noReturn(benchmark::State& state) -{ - static auto _ = []() { - auto err = sendMsg.bind().call(bm::g_longStr).err; + + namespace + { + static auto _test0 = []() + { + auto err = SendMessage(bm::g_longStr).err; + if (err != rtl::error::None) { - std::cout << "[0] err: "<< rtl::to_string(err)<<"\n"; + std::cout << "[0] error: "<< rtl::to_string(err)<<"\n"; } return 0; - }(); + }; - for (auto _ : state) + static auto _test1 = []() { - benchmark::DoNotOptimize(sendMsg.bind().call(bm::g_longStr)); - } -} + auto err = NodeSendMessage(robj)(bm::g_longStr).err; + if (err != rtl::error::None) { + std::cout << "[1] error: " << rtl::to_string(err) << "\n"; + } + return 0; + }; -void ReflectedCall::noReturnMethod(benchmark::State& state) -{ + static auto _test2 = []() + { + auto err = GetMessage(bm::g_longStr).err; - static auto _ = []() { - auto err = sendMsgMethod.bind(robj).call(bm::g_longStr).err; - if (err != rtl::error::None) { - std::cout << "[1] err: " << rtl::to_string(err) << "\n"; + if (err != rtl::error::None) { + std::cout << "[2] error: " << rtl::to_string(err) << "\n"; } return 0; - }(); + }; - for (auto _ : state) + static auto _test3 = []() { - benchmark::DoNotOptimize(sendMsgMethod.bind(robj).call(bm::g_longStr)); + auto err = NodeGetMessage(robj)(bm::g_longStr).err; + + if (err != rtl::error::None) { + std::cout << "[3] error: " << rtl::to_string(err) << "\n"; + } + return 0; + }; +} + + + +void ReflectedCall::noReturn(benchmark::State& state) +{ + static auto _=_test0(); + for (auto _: state) { + + auto error = SendMessage.bind().call(bm::g_longStr).err; + benchmark::DoNotOptimize(error); } } void ReflectedCall::withReturn(benchmark::State& state) { - static rtl::Function getMsg = cxx_mirror().getFunction("getMessage").value(); - static auto _ = []() { - auto err = getMsg.bind().call(bm::g_longStr).err; - if (err != rtl::error::None) { - std::cout << "[2] err: " << rtl::to_string(err) << "\n"; - } - return 0; - }(); - - for (auto _ : state) + static auto _=_test2(); + for (auto _: state) { - benchmark::DoNotOptimize(getMsg.bind().call(bm::g_longStr)); + auto error = GetMessage.bind().call(bm::g_longStr).err; + benchmark::DoNotOptimize(error); } } -void ReflectedCall::withReturnMethod(benchmark::State& state) +void ReflectedMethodCall::noReturn(benchmark::State& state) { - static auto _ = []() { - auto err = getMsgMethod.bind(robj).call(bm::g_longStr).err; - if (err != rtl::error::None) { - std::cout << "[3] err: " << rtl::to_string(err) << "\n"; - } - return 0; - }(); + static auto _=_test1(); + for (auto _: state) + { + auto error = NodeSendMessage.bind(robj).call(bm::g_longStr).err; + benchmark::DoNotOptimize(error); + } +} - for (auto _ : state) + +void ReflectedMethodCall::withReturn(benchmark::State& state) +{ + static auto _=_test3(); + for (auto _: state) { - benchmark::DoNotOptimize(getMsgMethod.bind(robj).call(bm::g_longStr)); + auto error = NodeGetMessage.bind(robj).call(bm::g_longStr).err; + benchmark::DoNotOptimize(error); } } \ No newline at end of file diff --git a/RTLBenchmarkApp/src/ReflectedCall.h b/RTLBenchmarkApp/src/ReflectedCall.h index 78b4aeaf..d4e3e98c 100644 --- a/RTLBenchmarkApp/src/ReflectedCall.h +++ b/RTLBenchmarkApp/src/ReflectedCall.h @@ -5,10 +5,14 @@ struct ReflectedCall { static void noReturn(benchmark::State& state); - - static void noReturnMethod(benchmark::State& state); static void withReturn(benchmark::State& state); - - static void withReturnMethod(benchmark::State& state); }; + + +struct ReflectedMethodCall +{ + static void noReturn(benchmark::State& state); + + static void withReturn(benchmark::State& state); +}; \ No newline at end of file diff --git a/RTLBenchmarkApp/src/StandardCall.cpp b/RTLBenchmarkApp/src/StandardCall.cpp index e1388e0b..ee4a1b45 100644 --- a/RTLBenchmarkApp/src/StandardCall.cpp +++ b/RTLBenchmarkApp/src/StandardCall.cpp @@ -3,49 +3,53 @@ #include #include "StandardCall.h" +extern std::optional g_work_done; + +namespace +{ + static auto _put_line = []() { + std::cout << "-------------------------------------" + "-------------------------------------" << std::endl; + return 0; + }; + + static auto _new_line = []() { + std::cout << std::endl; + return 0; + }; +} + namespace { static bm::Node node; - static std::function sendMsg = [](bm::argStr_t& pMsg) + static std::function SendMessage = [](bm::argStr_t& pMsg) { volatile auto* p = &pMsg; static_cast(p); bm::sendMessage(pMsg); }; - static std::function sendMsgMethod = [](bm::argStr_t& pMsg) + static std::function NodeSendMessage = [](bm::argStr_t& pMsg) { volatile auto* p = &pMsg; static_cast(p); node.sendMessage(pMsg); }; - static std::function getMsg = [](bm::argStr_t& pMsg) + static std::function GetMessage = [](bm::argStr_t& pMsg) { - { - volatile auto* p = &pMsg; - static_cast(p); - } - const auto& retMsg = bm::getMessage(pMsg); - { - volatile auto* p = &retMsg; - static_cast(p); - } + auto retMsg = bm::getMessage(pMsg); + volatile auto* p = &retMsg; + static_cast(p); return retMsg; }; - static std::function getMsgMethod = [](bm::argStr_t& pMsg) + static std::function NodeGetMessage = [](bm::argStr_t& pMsg) { - { - volatile auto* p = &pMsg; - static_cast(p); - } - const auto& retMsg = node.getMessage(pMsg); - { - volatile auto* p = &retMsg; - static_cast(p); - } + auto retMsg = node.getMessage(pMsg); + volatile auto* p = &retMsg; + static_cast(p); return retMsg; }; } @@ -53,23 +57,18 @@ namespace void DirectCall::noReturn(benchmark::State& state) { - for (auto _ : state) + for (auto _: state) { bm::sendMessage(bm::g_longStr); - benchmark::DoNotOptimize(bm::g_msg); + benchmark::DoNotOptimize(g_work_done->c_str()); } } void DirectCall::withReturn(benchmark::State& state) { - static auto _ = []() { - std::cout << "--------------------------------------" - "--------------------------------------" << std::endl; - return 0; - }(); - - for (auto _ : state) + static auto _=_put_line(); + for (auto _: state) { benchmark::DoNotOptimize(bm::getMessage(bm::g_longStr)); } @@ -77,39 +76,41 @@ void DirectCall::withReturn(benchmark::State& state) -void StdFunctionCall::noReturn(benchmark::State& state) +void StdFuncCall::noReturn(benchmark::State& state) { - for (auto _ : state) + for (auto _: state) { - sendMsg(bm::g_longStr); - benchmark::DoNotOptimize(bm::g_msg); + SendMessage(bm::g_longStr); + benchmark::DoNotOptimize(g_work_done->c_str()); } } -void StdFunctionCall::noReturnMethod(benchmark::State& state) +void StdFuncMethodCall::noReturn(benchmark::State& state) { - for (auto _ : state) + static auto _=_new_line(); + for (auto _: state) { - sendMsgMethod(bm::g_longStr); - benchmark::DoNotOptimize(bm::g_msg); + NodeSendMessage(bm::g_longStr); + benchmark::DoNotOptimize(g_work_done->c_str()); } } -void StdFunctionCall::withReturn(benchmark::State& state) +void StdFuncCall::withReturn(benchmark::State& state) { - for (auto _ : state) + for (auto _: state) { - benchmark::DoNotOptimize(getMsg(bm::g_longStr)); + benchmark::DoNotOptimize(GetMessage(bm::g_longStr)); } } -void StdFunctionCall::withReturnMethod(benchmark::State& state) +void StdFuncMethodCall::withReturn(benchmark::State& state) { - for (auto _ : state) + static auto _=_new_line(); + for (auto _: state) { - benchmark::DoNotOptimize(getMsgMethod(bm::g_longStr)); + benchmark::DoNotOptimize(NodeGetMessage(bm::g_longStr)); } } \ No newline at end of file diff --git a/RTLBenchmarkApp/src/StandardCall.h b/RTLBenchmarkApp/src/StandardCall.h index 94bb757a..3eb90b80 100644 --- a/RTLBenchmarkApp/src/StandardCall.h +++ b/RTLBenchmarkApp/src/StandardCall.h @@ -10,13 +10,17 @@ struct DirectCall }; -struct StdFunctionCall +struct StdFuncCall { static void noReturn(benchmark::State& state); - - static void noReturnMethod(benchmark::State& state); static void withReturn(benchmark::State& state); +}; + - static void withReturnMethod(benchmark::State& state); +struct StdFuncMethodCall +{ + static void noReturn(benchmark::State& state); + + static void withReturn(benchmark::State& state); }; \ No newline at end of file diff --git a/RTLBenchmarkApp/src/main.cpp b/RTLBenchmarkApp/src/main.cpp index adc4f076..27c1ac6e 100644 --- a/RTLBenchmarkApp/src/main.cpp +++ b/RTLBenchmarkApp/src/main.cpp @@ -5,18 +5,44 @@ #include "StandardCall.h" #include "ReflectedCall.h" -std::size_t g_work_load_scale = 1; - BENCHMARK(DirectCall::noReturn); -BENCHMARK(StdFunctionCall::noReturn); -BENCHMARK(StdFunctionCall::noReturnMethod); +BENCHMARK(StdFuncCall::noReturn); BENCHMARK(ReflectedCall::noReturn); -BENCHMARK(ReflectedCall::noReturnMethod); + +BENCHMARK(StdFuncMethodCall::noReturn); +BENCHMARK(ReflectedMethodCall::noReturn); BENCHMARK(DirectCall::withReturn); -BENCHMARK(StdFunctionCall::withReturn); -BENCHMARK(StdFunctionCall::withReturnMethod); +BENCHMARK(StdFuncCall::withReturn); BENCHMARK(ReflectedCall::withReturn); -BENCHMARK(ReflectedCall::withReturnMethod); -BENCHMARK_MAIN(); \ No newline at end of file +BENCHMARK(StdFuncMethodCall::withReturn); +BENCHMARK(ReflectedMethodCall::withReturn); + +std::size_t g_work_load_scale = 1; + +std::optional g_work_done; + +#include +#include + +int main(int argc, char** argv) +{ + if (argc > 1) + { + g_work_load_scale = std::stoi(argv[1]); + for (int i = 1; i < argc - 1; ++i) { + argv[i] = argv[i + 1]; + } + --argc; + + std::cout << "\n======== RTL Benchmark Configuration ========\n" + << "Workload: concatenate string of length 500\n" + << "Scale : " << g_work_load_scale << " iterations\n" + << "=============================================\n\n"; + } + + ::benchmark::Initialize(&argc, argv); + if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1; + ::benchmark::RunSpecifiedBenchmarks(); +} diff --git a/benchmarks-stat-log/benchmark_return_string_view.log b/benchmarks-stat-log/benchmark_return_string_view.log new file mode 100644 index 00000000..1acdfca7 --- /dev/null +++ b/benchmarks-stat-log/benchmark_return_string_view.log @@ -0,0 +1,1655 @@ +Starting benchmark runs... +Binary: ./bin/RTLBenchmarkApp +Log: ./benchmark_runs.log +=================================== +>>> Run 1: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:26:58+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3673.84 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.50, 0.43, 0.62 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.68 ns 2.68 ns 261129948 +StdFuncCall::noReturn 3.63 ns 3.63 ns 205756521 +ReflectedCall::noReturn 4.56 ns 4.56 ns 152287993 + +StdFuncMethodCall::noReturn 3.66 ns 3.66 ns 190424278 +ReflectedMethodCall::noReturn 7.58 ns 7.58 ns 91861976 +-------------------------------------------------------------------------- +DirectCall::withReturn 7.99 ns 7.99 ns 87640884 +StdFuncCall::withReturn 8.19 ns 8.19 ns 85275679 +ReflectedCall::withReturn 16.4 ns 16.4 ns 42162218 + +StdFuncMethodCall::withReturn 8.19 ns 8.19 ns 85314435 +ReflectedMethodCall::withReturn 18.4 ns 18.4 ns 38123916 +----------------------------------- +>>> Run 2: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:27:07+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4900 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.58, 0.45, 0.63 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.68 ns 2.68 ns 261249982 +StdFuncCall::noReturn 3.53 ns 3.53 ns 193958493 +ReflectedCall::noReturn 4.54 ns 4.54 ns 154118128 + +StdFuncMethodCall::noReturn 3.70 ns 3.70 ns 189590103 +ReflectedMethodCall::noReturn 7.66 ns 7.66 ns 92278133 +-------------------------------------------------------------------------- +DirectCall::withReturn 7.98 ns 7.98 ns 87518334 +StdFuncCall::withReturn 8.20 ns 8.20 ns 85410105 +ReflectedCall::withReturn 16.5 ns 16.5 ns 42955309 + +StdFuncMethodCall::withReturn 8.19 ns 8.19 ns 85484532 +ReflectedMethodCall::withReturn 18.5 ns 18.5 ns 37798366 +----------------------------------- +>>> Run 3: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:27:17+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4894.06 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.64, 0.47, 0.63 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.68 ns 2.68 ns 262137459 +StdFuncCall::noReturn 3.66 ns 3.66 ns 186118715 +ReflectedCall::noReturn 4.56 ns 4.56 ns 152295433 + +StdFuncMethodCall::noReturn 3.65 ns 3.65 ns 193507678 +ReflectedMethodCall::noReturn 7.68 ns 7.68 ns 89857228 +-------------------------------------------------------------------------- +DirectCall::withReturn 7.99 ns 7.99 ns 87152273 +StdFuncCall::withReturn 8.19 ns 8.19 ns 84706545 +ReflectedCall::withReturn 16.3 ns 16.3 ns 42842896 + +StdFuncMethodCall::withReturn 8.19 ns 8.19 ns 84681044 +ReflectedMethodCall::withReturn 18.5 ns 18.5 ns 38078832 +----------------------------------- +>>> Run 4: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:27:26+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3764.4 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.70, 0.48, 0.64 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.69 ns 2.69 ns 261376697 +StdFuncCall::noReturn 3.71 ns 3.71 ns 190913629 +ReflectedCall::noReturn 4.71 ns 4.71 ns 150141200 + +StdFuncMethodCall::noReturn 3.64 ns 3.64 ns 192162902 +ReflectedMethodCall::noReturn 7.67 ns 7.67 ns 90578497 +-------------------------------------------------------------------------- +DirectCall::withReturn 8.19 ns 8.19 ns 85408568 +StdFuncCall::withReturn 8.39 ns 8.39 ns 83226473 +ReflectedCall::withReturn 16.7 ns 16.7 ns 41844284 + +StdFuncMethodCall::withReturn 8.39 ns 8.39 ns 83073249 +ReflectedMethodCall::withReturn 18.4 ns 18.4 ns 37663093 +----------------------------------- +>>> Run 5: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:27:35+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1321.93 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.72, 0.49, 0.64 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.69 ns 2.69 ns 259677166 +StdFuncCall::noReturn 3.63 ns 3.63 ns 190282286 +ReflectedCall::noReturn 4.64 ns 4.64 ns 150576640 + +StdFuncMethodCall::noReturn 3.70 ns 3.70 ns 189991616 +ReflectedMethodCall::noReturn 7.59 ns 7.58 ns 88533673 +-------------------------------------------------------------------------- +DirectCall::withReturn 7.98 ns 7.98 ns 86873175 +StdFuncCall::withReturn 8.20 ns 8.20 ns 84535948 +ReflectedCall::withReturn 16.5 ns 16.5 ns 42143122 + +StdFuncMethodCall::withReturn 8.19 ns 8.19 ns 85127244 +ReflectedMethodCall::withReturn 18.7 ns 18.7 ns 37470244 +----------------------------------- +>>> Run 6: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:27:45+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2798.79 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.76, 0.51, 0.64 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.68 ns 2.68 ns 258313912 +StdFuncCall::noReturn 3.45 ns 3.45 ns 202668270 +ReflectedCall::noReturn 4.45 ns 4.45 ns 155726805 + +StdFuncMethodCall::noReturn 3.66 ns 3.66 ns 195257109 +ReflectedMethodCall::noReturn 7.72 ns 7.71 ns 91691488 +-------------------------------------------------------------------------- +DirectCall::withReturn 8.40 ns 8.40 ns 83232030 +StdFuncCall::withReturn 8.19 ns 8.19 ns 84719682 +ReflectedCall::withReturn 16.4 ns 16.4 ns 41763228 + +StdFuncMethodCall::withReturn 8.19 ns 8.19 ns 85406769 +ReflectedMethodCall::withReturn 18.5 ns 18.5 ns 38342729 +----------------------------------- +>>> Run 7: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:27:54+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4820.72 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.80, 0.53, 0.65 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.70 ns 2.70 ns 255687919 +StdFuncCall::noReturn 3.80 ns 3.80 ns 192744917 +ReflectedCall::noReturn 4.54 ns 4.54 ns 155638851 + +StdFuncMethodCall::noReturn 3.71 ns 3.71 ns 189990747 +ReflectedMethodCall::noReturn 7.65 ns 7.65 ns 90475902 +-------------------------------------------------------------------------- +DirectCall::withReturn 8.41 ns 8.41 ns 82783681 +StdFuncCall::withReturn 8.19 ns 8.19 ns 85113727 +ReflectedCall::withReturn 16.4 ns 16.3 ns 43469078 + +StdFuncMethodCall::withReturn 8.21 ns 8.21 ns 85061209 +ReflectedMethodCall::withReturn 18.4 ns 18.4 ns 38318216 +----------------------------------- +>>> Run 8: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:28:04+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.83, 0.54, 0.65 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.67 ns 2.67 ns 259545419 +StdFuncCall::noReturn 3.68 ns 3.68 ns 186620879 +ReflectedCall::noReturn 4.68 ns 4.68 ns 151229098 + +StdFuncMethodCall::noReturn 3.69 ns 3.69 ns 192148650 +ReflectedMethodCall::noReturn 7.65 ns 7.64 ns 92628011 +-------------------------------------------------------------------------- +DirectCall::withReturn 7.98 ns 7.98 ns 87367388 +StdFuncCall::withReturn 8.20 ns 8.20 ns 85464076 +ReflectedCall::withReturn 16.4 ns 16.4 ns 41631547 + +StdFuncMethodCall::withReturn 8.19 ns 8.19 ns 84841078 +ReflectedMethodCall::withReturn 18.5 ns 18.5 ns 38096443 +----------------------------------- +>>> Run 9: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:28:13+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2581.19 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.86, 0.56, 0.66 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.69 ns 2.69 ns 261320876 +StdFuncCall::noReturn 3.76 ns 3.76 ns 183274387 +ReflectedCall::noReturn 4.55 ns 4.55 ns 154257846 + +StdFuncMethodCall::noReturn 3.69 ns 3.69 ns 183824695 +ReflectedMethodCall::noReturn 7.67 ns 7.67 ns 91673266 +-------------------------------------------------------------------------- +DirectCall::withReturn 8.39 ns 8.39 ns 82340975 +StdFuncCall::withReturn 8.19 ns 8.19 ns 85259148 +ReflectedCall::withReturn 16.5 ns 16.5 ns 43168408 + +StdFuncMethodCall::withReturn 8.19 ns 8.19 ns 85150908 +ReflectedMethodCall::withReturn 18.4 ns 18.4 ns 38115440 +----------------------------------- +>>> Run 10: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:28:22+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4020.89 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.88, 0.57, 0.66 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.68 ns 2.68 ns 261232254 +StdFuncCall::noReturn 3.75 ns 3.75 ns 187932171 +ReflectedCall::noReturn 4.51 ns 4.51 ns 152128258 + +StdFuncMethodCall::noReturn 3.65 ns 3.64 ns 190154894 +ReflectedMethodCall::noReturn 7.63 ns 7.63 ns 92473165 +-------------------------------------------------------------------------- +DirectCall::withReturn 8.40 ns 8.40 ns 83290327 +StdFuncCall::withReturn 8.18 ns 8.18 ns 85083846 +ReflectedCall::withReturn 16.7 ns 16.7 ns 41687403 + +StdFuncMethodCall::withReturn 8.20 ns 8.20 ns 85490157 +ReflectedMethodCall::withReturn 18.5 ns 18.5 ns 38928701 +----------------------------------- +>>> Run 1: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:28:32+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3453.76 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.90, 0.59, 0.66 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 301 ns 301 ns 2303982 +StdFuncCall::noReturn 300 ns 300 ns 2342931 +ReflectedCall::noReturn 306 ns 306 ns 2284404 + +StdFuncMethodCall::noReturn 301 ns 301 ns 2329281 +ReflectedMethodCall::noReturn 309 ns 309 ns 2277267 +-------------------------------------------------------------------------- +DirectCall::withReturn 373 ns 373 ns 1874653 +StdFuncCall::withReturn 370 ns 370 ns 1870666 +ReflectedCall::withReturn 385 ns 385 ns 1817975 + +StdFuncMethodCall::withReturn 372 ns 372 ns 1861488 +ReflectedMethodCall::withReturn 387 ns 387 ns 1808677 +----------------------------------- +>>> Run 2: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:28:42+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1209.55 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.92, 0.60, 0.67 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 307 ns 307 ns 2302722 +StdFuncCall::noReturn 305 ns 305 ns 2290835 +ReflectedCall::noReturn 303 ns 303 ns 2297945 + +StdFuncMethodCall::noReturn 306 ns 306 ns 2296470 +ReflectedMethodCall::noReturn 305 ns 305 ns 2290296 +-------------------------------------------------------------------------- +DirectCall::withReturn 380 ns 380 ns 1843902 +StdFuncCall::withReturn 430 ns 430 ns 1754632 +ReflectedCall::withReturn 440 ns 440 ns 1589233 + +StdFuncMethodCall::withReturn 431 ns 431 ns 1624807 +ReflectedMethodCall::withReturn 433 ns 433 ns 1611959 +----------------------------------- +>>> Run 3: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:28:54+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.93, 0.62, 0.67 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 298 ns 298 ns 2339343 +StdFuncCall::noReturn 298 ns 298 ns 2362369 +ReflectedCall::noReturn 301 ns 301 ns 2308822 + +StdFuncMethodCall::noReturn 297 ns 297 ns 2342636 +ReflectedMethodCall::noReturn 341 ns 341 ns 2303815 +-------------------------------------------------------------------------- +DirectCall::withReturn 425 ns 425 ns 1654379 +StdFuncCall::withReturn 424 ns 424 ns 1650814 +ReflectedCall::withReturn 434 ns 434 ns 1612383 + +StdFuncMethodCall::withReturn 426 ns 426 ns 1639874 +ReflectedMethodCall::withReturn 434 ns 434 ns 1616096 +----------------------------------- +>>> Run 4: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:29:05+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 0.94, 0.63, 0.67 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 341 ns 341 ns 2060360 +StdFuncCall::noReturn 334 ns 334 ns 2092530 +ReflectedCall::noReturn 336 ns 336 ns 2084367 + +StdFuncMethodCall::noReturn 335 ns 335 ns 2086575 +ReflectedMethodCall::noReturn 344 ns 344 ns 2032773 +-------------------------------------------------------------------------- +DirectCall::withReturn 421 ns 421 ns 1662603 +StdFuncCall::withReturn 423 ns 423 ns 1666937 +ReflectedCall::withReturn 431 ns 431 ns 1623342 + +StdFuncMethodCall::withReturn 421 ns 421 ns 1658766 +ReflectedMethodCall::withReturn 433 ns 433 ns 1618268 +----------------------------------- +>>> Run 5: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:29:16+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4781.24 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.03, 0.66, 0.68 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 339 ns 339 ns 2086251 +StdFuncCall::noReturn 334 ns 334 ns 2096201 +ReflectedCall::noReturn 336 ns 336 ns 2079979 + +StdFuncMethodCall::noReturn 335 ns 335 ns 2092323 +ReflectedMethodCall::noReturn 344 ns 344 ns 2037126 +-------------------------------------------------------------------------- +DirectCall::withReturn 420 ns 420 ns 1666613 +StdFuncCall::withReturn 420 ns 420 ns 1674857 +ReflectedCall::withReturn 431 ns 431 ns 1620878 + +StdFuncMethodCall::withReturn 420 ns 420 ns 1654424 +ReflectedMethodCall::withReturn 432 ns 432 ns 1616853 +----------------------------------- +>>> Run 1: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:29:27+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2132.68 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.34, 0.74, 0.71 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 901 ns 901 ns 759524 +StdFuncCall::noReturn 906 ns 906 ns 767684 +ReflectedCall::noReturn 912 ns 912 ns 765256 + +StdFuncMethodCall::noReturn 906 ns 906 ns 769566 +ReflectedMethodCall::noReturn 916 ns 916 ns 762842 +-------------------------------------------------------------------------- +DirectCall::withReturn 1036 ns 1036 ns 675246 +StdFuncCall::withReturn 1035 ns 1034 ns 675401 +ReflectedCall::withReturn 1048 ns 1048 ns 667279 + +StdFuncMethodCall::withReturn 1035 ns 1034 ns 676395 +ReflectedMethodCall::withReturn 1053 ns 1053 ns 665275 +----------------------------------- +>>> Run 2: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:29:35+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.32, 0.75, 0.71 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 897 ns 897 ns 759896 +StdFuncCall::noReturn 902 ns 902 ns 776407 +ReflectedCall::noReturn 913 ns 913 ns 769246 + +StdFuncMethodCall::noReturn 902 ns 902 ns 776430 +ReflectedMethodCall::noReturn 919 ns 918 ns 760482 +-------------------------------------------------------------------------- +DirectCall::withReturn 1042 ns 1042 ns 671791 +StdFuncCall::withReturn 1041 ns 1041 ns 671217 +ReflectedCall::withReturn 1051 ns 1051 ns 664465 + +StdFuncMethodCall::withReturn 1041 ns 1041 ns 672055 +ReflectedMethodCall::withReturn 1057 ns 1057 ns 661898 +----------------------------------- +>>> Run 3: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:29:43+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1717.77 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.27, 0.76, 0.72 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 895 ns 894 ns 770126 +StdFuncCall::noReturn 902 ns 902 ns 775366 +ReflectedCall::noReturn 911 ns 911 ns 768376 + +StdFuncMethodCall::noReturn 901 ns 901 ns 772646 +ReflectedMethodCall::noReturn 932 ns 932 ns 748823 +-------------------------------------------------------------------------- +DirectCall::withReturn 1035 ns 1035 ns 675872 +StdFuncCall::withReturn 1034 ns 1034 ns 672118 +ReflectedCall::withReturn 1052 ns 1052 ns 661468 + +StdFuncMethodCall::withReturn 1035 ns 1035 ns 672736 +ReflectedMethodCall::withReturn 1061 ns 1061 ns 659470 +----------------------------------- +>>> Run 4: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:29:51+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2364.83 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.23, 0.76, 0.72 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 899 ns 899 ns 757381 +StdFuncCall::noReturn 904 ns 904 ns 769320 +ReflectedCall::noReturn 911 ns 911 ns 762634 + +StdFuncMethodCall::noReturn 902 ns 902 ns 767011 +ReflectedMethodCall::noReturn 954 ns 954 ns 726736 +-------------------------------------------------------------------------- +DirectCall::withReturn 1075 ns 1075 ns 651123 +StdFuncCall::withReturn 1078 ns 1078 ns 648677 +ReflectedCall::withReturn 1087 ns 1087 ns 640363 + +StdFuncMethodCall::withReturn 1076 ns 1076 ns 648598 +ReflectedMethodCall::withReturn 1118 ns 1118 ns 625917 +----------------------------------- +>>> Run 5: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:29:59+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.21, 0.77, 0.72 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 896 ns 896 ns 767762 +StdFuncCall::noReturn 910 ns 910 ns 763215 +ReflectedCall::noReturn 923 ns 923 ns 755913 + +StdFuncMethodCall::noReturn 910 ns 909 ns 760598 +ReflectedMethodCall::noReturn 928 ns 928 ns 750732 +-------------------------------------------------------------------------- +DirectCall::withReturn 1080 ns 1080 ns 644211 +StdFuncCall::withReturn 1081 ns 1081 ns 642103 +ReflectedCall::withReturn 1095 ns 1095 ns 638553 + +StdFuncMethodCall::withReturn 1082 ns 1082 ns 642934 +ReflectedMethodCall::withReturn 1098 ns 1098 ns 633816 +----------------------------------- +>>> Run 1: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:30:08+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2499.32 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.17, 0.78, 0.73 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1718 ns 1718 ns 403509 +StdFuncCall::noReturn 1711 ns 1711 ns 408919 +ReflectedCall::noReturn 1719 ns 1719 ns 406569 + +StdFuncMethodCall::noReturn 1710 ns 1710 ns 409246 +ReflectedMethodCall::noReturn 1735 ns 1735 ns 403276 +-------------------------------------------------------------------------- +DirectCall::withReturn 1942 ns 1942 ns 360231 +StdFuncCall::withReturn 1944 ns 1944 ns 359937 +ReflectedCall::withReturn 1967 ns 1967 ns 355508 + +StdFuncMethodCall::withReturn 1945 ns 1945 ns 360153 +ReflectedMethodCall::withReturn 1971 ns 1971 ns 354944 +----------------------------------- +>>> Run 2: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:30:17+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2418.55 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.15, 0.78, 0.73 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1720 ns 1719 ns 403240 +StdFuncCall::noReturn 1711 ns 1711 ns 409539 +ReflectedCall::noReturn 1722 ns 1722 ns 407137 + +StdFuncMethodCall::noReturn 1710 ns 1710 ns 408876 +ReflectedMethodCall::noReturn 1735 ns 1735 ns 403563 +-------------------------------------------------------------------------- +DirectCall::withReturn 1905 ns 1905 ns 364610 +StdFuncCall::withReturn 1906 ns 1905 ns 367144 +ReflectedCall::withReturn 1932 ns 1931 ns 362876 + +StdFuncMethodCall::withReturn 1904 ns 1904 ns 367010 +ReflectedMethodCall::withReturn 1941 ns 1940 ns 360733 +----------------------------------- +>>> Run 3: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:30:26+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4754.64 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.14, 0.79, 0.73 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1700 ns 1700 ns 408515 +StdFuncCall::noReturn 1706 ns 1706 ns 411515 +ReflectedCall::noReturn 1711 ns 1710 ns 409353 + +StdFuncMethodCall::noReturn 1702 ns 1702 ns 410901 +ReflectedMethodCall::noReturn 1723 ns 1722 ns 406169 +-------------------------------------------------------------------------- +DirectCall::withReturn 1888 ns 1888 ns 370526 +StdFuncCall::withReturn 1888 ns 1887 ns 370612 +ReflectedCall::withReturn 1916 ns 1916 ns 365093 + +StdFuncMethodCall::withReturn 1890 ns 1889 ns 371318 +ReflectedMethodCall::withReturn 1927 ns 1927 ns 362766 +----------------------------------- +>>> Run 4: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:30:35+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1859.33 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.11, 0.80, 0.73 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1708 ns 1707 ns 404396 +StdFuncCall::noReturn 1709 ns 1708 ns 409461 +ReflectedCall::noReturn 1717 ns 1717 ns 407033 + +StdFuncMethodCall::noReturn 1708 ns 1708 ns 409492 +ReflectedMethodCall::noReturn 1732 ns 1731 ns 404102 +-------------------------------------------------------------------------- +DirectCall::withReturn 1949 ns 1948 ns 359921 +StdFuncCall::withReturn 1944 ns 1944 ns 360031 +ReflectedCall::withReturn 1969 ns 1968 ns 355377 + +StdFuncMethodCall::withReturn 2043 ns 2042 ns 358913 +ReflectedMethodCall::withReturn 2102 ns 2102 ns 351247 +----------------------------------- +>>> Run 5: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:30:44+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4274.37 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.10, 0.80, 0.74 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1854 ns 1853 ns 369519 +StdFuncCall::noReturn 1804 ns 1804 ns 389051 +ReflectedCall::noReturn 1768 ns 1767 ns 372147 + +StdFuncMethodCall::noReturn 1845 ns 1845 ns 366941 +ReflectedMethodCall::noReturn 1892 ns 1891 ns 390576 +-------------------------------------------------------------------------- +DirectCall::withReturn 2059 ns 2059 ns 321965 +StdFuncCall::withReturn 2102 ns 2102 ns 331998 +ReflectedCall::withReturn 2122 ns 2122 ns 333219 + +StdFuncMethodCall::withReturn 2060 ns 2060 ns 333788 +ReflectedMethodCall::withReturn 2079 ns 2079 ns 331928 +----------------------------------- +>>> Run 1: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:30:53+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.24, 0.84, 0.75 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1960 ns 1959 ns 357975 +StdFuncCall::noReturn 2034 ns 2034 ns 341249 +ReflectedCall::noReturn 2022 ns 2022 ns 341827 + +StdFuncMethodCall::noReturn 2013 ns 2013 ns 303915 +ReflectedMethodCall::noReturn 2014 ns 2014 ns 343680 +-------------------------------------------------------------------------- +DirectCall::withReturn 2207 ns 2207 ns 310242 +StdFuncCall::withReturn 2217 ns 2216 ns 310202 +ReflectedCall::withReturn 2254 ns 2253 ns 304225 + +StdFuncMethodCall::withReturn 2240 ns 2239 ns 306452 +ReflectedMethodCall::withReturn 2265 ns 2264 ns 299926 +----------------------------------- +>>> Run 2: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:31:02+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3021.9 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.43, 0.90, 0.77 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1981 ns 1981 ns 342744 +StdFuncCall::noReturn 1966 ns 1965 ns 352075 +ReflectedCall::noReturn 2002 ns 2001 ns 345397 + +StdFuncMethodCall::noReturn 2081 ns 2080 ns 341551 +ReflectedMethodCall::noReturn 1969 ns 1969 ns 333753 +-------------------------------------------------------------------------- +DirectCall::withReturn 2207 ns 2207 ns 316294 +StdFuncCall::withReturn 2208 ns 2207 ns 308338 +ReflectedCall::withReturn 2215 ns 2215 ns 312972 + +StdFuncMethodCall::withReturn 2192 ns 2191 ns 314740 +ReflectedMethodCall::withReturn 2224 ns 2223 ns 305823 +----------------------------------- +>>> Run 3: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:31:11+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4705.12 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.44, 0.92, 0.78 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1940 ns 1939 ns 350727 +StdFuncCall::noReturn 1965 ns 1965 ns 347915 +ReflectedCall::noReturn 1951 ns 1951 ns 352534 + +StdFuncMethodCall::noReturn 1938 ns 1938 ns 359757 +ReflectedMethodCall::noReturn 1965 ns 1964 ns 356003 +-------------------------------------------------------------------------- +DirectCall::withReturn 2195 ns 2194 ns 317298 +StdFuncCall::withReturn 2197 ns 2196 ns 316093 +ReflectedCall::withReturn 2214 ns 2213 ns 302642 + +StdFuncMethodCall::withReturn 2197 ns 2197 ns 318178 +ReflectedMethodCall::withReturn 2227 ns 2226 ns 313484 +----------------------------------- +>>> Run 4: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:31:21+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2658.72 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.48, 0.94, 0.79 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2027 ns 2027 ns 330486 +StdFuncCall::noReturn 2014 ns 2013 ns 352994 +ReflectedCall::noReturn 2031 ns 2030 ns 345623 + +StdFuncMethodCall::noReturn 1982 ns 1982 ns 341573 +ReflectedMethodCall::noReturn 2017 ns 2017 ns 349908 +-------------------------------------------------------------------------- +DirectCall::withReturn 2296 ns 2296 ns 294346 +StdFuncCall::withReturn 2321 ns 2319 ns 300846 +ReflectedCall::withReturn 2360 ns 2360 ns 286766 + +StdFuncMethodCall::withReturn 2270 ns 2270 ns 301661 +ReflectedMethodCall::withReturn 2284 ns 2284 ns 291059 +----------------------------------- +>>> Run 5: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:31:30+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2259.74 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.71, 1.00, 0.81 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1977 ns 1977 ns 353401 +StdFuncCall::noReturn 2000 ns 2000 ns 345838 +ReflectedCall::noReturn 1986 ns 1985 ns 351401 + +StdFuncMethodCall::noReturn 1963 ns 1962 ns 353888 +ReflectedMethodCall::noReturn 1965 ns 1965 ns 348781 +-------------------------------------------------------------------------- +DirectCall::withReturn 2208 ns 2207 ns 312994 +StdFuncCall::withReturn 2208 ns 2208 ns 312348 +ReflectedCall::withReturn 2234 ns 2234 ns 311258 + +StdFuncMethodCall::withReturn 2210 ns 2209 ns 313612 +ReflectedMethodCall::withReturn 2243 ns 2243 ns 310464 +----------------------------------- +>>> Run 1: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:31:39+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2565.99 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.89, 1.07, 0.83 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2186 ns 2186 ns 298930 +StdFuncCall::noReturn 2180 ns 2179 ns 316013 +ReflectedCall::noReturn 2185 ns 2185 ns 317280 + +StdFuncMethodCall::noReturn 2178 ns 2178 ns 318283 +ReflectedMethodCall::noReturn 2199 ns 2199 ns 317096 +-------------------------------------------------------------------------- +DirectCall::withReturn 2651 ns 2651 ns 262036 +StdFuncCall::withReturn 2659 ns 2659 ns 262524 +ReflectedCall::withReturn 2687 ns 2686 ns 259459 + +StdFuncMethodCall::withReturn 2662 ns 2661 ns 260168 +ReflectedMethodCall::withReturn 2689 ns 2689 ns 255403 +----------------------------------- +>>> Run 2: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:31:49+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.76, 1.07, 0.84 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2167 ns 2166 ns 317573 +StdFuncCall::noReturn 2178 ns 2178 ns 319987 +ReflectedCall::noReturn 2173 ns 2172 ns 319725 + +StdFuncMethodCall::noReturn 2167 ns 2167 ns 319864 +ReflectedMethodCall::noReturn 2215 ns 2215 ns 314983 +-------------------------------------------------------------------------- +DirectCall::withReturn 2597 ns 2596 ns 267537 +StdFuncCall::withReturn 2609 ns 2608 ns 263587 +ReflectedCall::withReturn 2639 ns 2638 ns 264562 + +StdFuncMethodCall::withReturn 2594 ns 2593 ns 268609 +ReflectedMethodCall::withReturn 2649 ns 2648 ns 261252 +----------------------------------- +>>> Run 3: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:31:59+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.64, 1.06, 0.84 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2187 ns 2187 ns 311240 +StdFuncCall::noReturn 2195 ns 2195 ns 321853 +ReflectedCall::noReturn 2195 ns 2194 ns 315480 + +StdFuncMethodCall::noReturn 2188 ns 2187 ns 319537 +ReflectedMethodCall::noReturn 2212 ns 2212 ns 315561 +-------------------------------------------------------------------------- +DirectCall::withReturn 2636 ns 2635 ns 264251 +StdFuncCall::withReturn 2625 ns 2624 ns 264662 +ReflectedCall::withReturn 2654 ns 2653 ns 261530 + +StdFuncMethodCall::withReturn 2625 ns 2625 ns 262978 +ReflectedMethodCall::withReturn 2668 ns 2668 ns 259997 +----------------------------------- +>>> Run 4: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:32:08+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.54, 1.06, 0.84 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2181 ns 2180 ns 317614 +StdFuncCall::noReturn 2172 ns 2172 ns 317161 +ReflectedCall::noReturn 2190 ns 2190 ns 321018 + +StdFuncMethodCall::noReturn 2281 ns 2281 ns 304077 +ReflectedMethodCall::noReturn 2242 ns 2242 ns 290170 +-------------------------------------------------------------------------- +DirectCall::withReturn 2601 ns 2601 ns 266644 +StdFuncCall::withReturn 2723 ns 2723 ns 263459 +ReflectedCall::withReturn 2724 ns 2723 ns 257965 + +StdFuncMethodCall::withReturn 2611 ns 2611 ns 262426 +ReflectedMethodCall::withReturn 2683 ns 2682 ns 258950 +----------------------------------- +>>> Run 5: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:32:18+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.46, 1.06, 0.84 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2195 ns 2195 ns 313426 +StdFuncCall::noReturn 2183 ns 2182 ns 312811 +ReflectedCall::noReturn 2182 ns 2181 ns 320013 + +StdFuncMethodCall::noReturn 2184 ns 2184 ns 318661 +ReflectedMethodCall::noReturn 2194 ns 2194 ns 317609 +-------------------------------------------------------------------------- +DirectCall::withReturn 2601 ns 2601 ns 261526 +StdFuncCall::withReturn 2598 ns 2597 ns 266007 +ReflectedCall::withReturn 2623 ns 2623 ns 264649 + +StdFuncMethodCall::withReturn 2593 ns 2593 ns 268179 +ReflectedMethodCall::withReturn 2643 ns 2642 ns 261745 +----------------------------------- +>>> Run 1: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:32:28+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.46, 1.07, 0.85 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3533 ns 3532 ns 195801 +StdFuncCall::noReturn 3526 ns 3525 ns 197420 +ReflectedCall::noReturn 3535 ns 3535 ns 196633 + +StdFuncMethodCall::noReturn 3524 ns 3523 ns 197148 +ReflectedMethodCall::noReturn 3546 ns 3546 ns 194787 +-------------------------------------------------------------------------- +DirectCall::withReturn 3992 ns 3992 ns 173680 +StdFuncCall::withReturn 3995 ns 3994 ns 174034 +ReflectedCall::withReturn 4028 ns 4028 ns 172386 + +StdFuncMethodCall::withReturn 3989 ns 3989 ns 173898 +ReflectedMethodCall::withReturn 4041 ns 4040 ns 172324 +----------------------------------- +>>> Run 2: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:32:39+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3872.32 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.47, 1.09, 0.86 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3520 ns 3520 ns 194024 +StdFuncCall::noReturn 3532 ns 3532 ns 196774 +ReflectedCall::noReturn 3531 ns 3530 ns 196912 + +StdFuncMethodCall::noReturn 3527 ns 3526 ns 197173 +ReflectedMethodCall::noReturn 3545 ns 3544 ns 195935 +-------------------------------------------------------------------------- +DirectCall::withReturn 3988 ns 3987 ns 174580 +StdFuncCall::withReturn 3986 ns 3985 ns 175002 +ReflectedCall::withReturn 4015 ns 4014 ns 172705 + +StdFuncMethodCall::withReturn 4088 ns 4087 ns 174540 +ReflectedMethodCall::withReturn 4095 ns 4094 ns 169848 +----------------------------------- +>>> Run 3: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:32:50+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.40, 1.08, 0.86 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3552 ns 3552 ns 195236 +StdFuncCall::noReturn 3563 ns 3562 ns 195128 +ReflectedCall::noReturn 3559 ns 3558 ns 195504 + +StdFuncMethodCall::noReturn 3559 ns 3559 ns 195249 +ReflectedMethodCall::noReturn 3574 ns 3573 ns 195050 +-------------------------------------------------------------------------- +DirectCall::withReturn 4036 ns 4035 ns 173264 +StdFuncCall::withReturn 4022 ns 4021 ns 171261 +ReflectedCall::withReturn 4060 ns 4059 ns 171454 + +StdFuncMethodCall::withReturn 4025 ns 4024 ns 172789 +ReflectedMethodCall::withReturn 4065 ns 4064 ns 171108 +----------------------------------- +>>> Run 4: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:33:01+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.41, 1.10, 0.87 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3500 ns 3500 ns 197777 +StdFuncCall::noReturn 3519 ns 3518 ns 198267 +ReflectedCall::noReturn 3539 ns 3538 ns 197240 + +StdFuncMethodCall::noReturn 3539 ns 3538 ns 197720 +ReflectedMethodCall::noReturn 3563 ns 3563 ns 196002 +-------------------------------------------------------------------------- +DirectCall::withReturn 4079 ns 4078 ns 171166 +StdFuncCall::withReturn 4069 ns 4069 ns 171810 +ReflectedCall::withReturn 4099 ns 4097 ns 170406 + +StdFuncMethodCall::withReturn 4063 ns 4061 ns 170961 +ReflectedMethodCall::withReturn 4036 ns 4035 ns 172161 +----------------------------------- +>>> Run 5: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:33:12+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1801.89 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.39, 1.11, 0.87 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3537 ns 3536 ns 198280 +StdFuncCall::noReturn 3515 ns 3515 ns 198830 +ReflectedCall::noReturn 3521 ns 3520 ns 198314 + +StdFuncMethodCall::noReturn 3514 ns 3514 ns 196875 +ReflectedMethodCall::noReturn 3586 ns 3586 ns 194396 +-------------------------------------------------------------------------- +DirectCall::withReturn 4039 ns 4038 ns 173252 +StdFuncCall::withReturn 4029 ns 4029 ns 174445 +ReflectedCall::withReturn 4015 ns 4014 ns 172859 + +StdFuncMethodCall::withReturn 3996 ns 3996 ns 174457 +ReflectedMethodCall::withReturn 4030 ns 4029 ns 172232 +----------------------------------- +>>> Run 1: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:33:24+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4390.34 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.33, 1.10, 0.88 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3802 ns 3801 ns 184513 +StdFuncCall::noReturn 3795 ns 3794 ns 184144 +ReflectedCall::noReturn 3790 ns 3789 ns 184898 + +StdFuncMethodCall::noReturn 3765 ns 3764 ns 177760 +ReflectedMethodCall::noReturn 3778 ns 3778 ns 183638 +-------------------------------------------------------------------------- +DirectCall::withReturn 4329 ns 4328 ns 161157 +StdFuncCall::withReturn 4332 ns 4330 ns 160003 +ReflectedCall::withReturn 4367 ns 4366 ns 159612 + +StdFuncMethodCall::withReturn 4335 ns 4335 ns 160361 +ReflectedMethodCall::withReturn 4372 ns 4371 ns 159538 +----------------------------------- +>>> Run 2: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:33:35+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4300.1 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.28, 1.10, 0.88 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3778 ns 3777 ns 183159 +StdFuncCall::noReturn 3762 ns 3761 ns 185032 +ReflectedCall::noReturn 3764 ns 3762 ns 185710 + +StdFuncMethodCall::noReturn 3758 ns 3757 ns 185331 +ReflectedMethodCall::noReturn 3779 ns 3778 ns 176155 +-------------------------------------------------------------------------- +DirectCall::withReturn 4339 ns 4338 ns 159051 +StdFuncCall::withReturn 4342 ns 4342 ns 160567 +ReflectedCall::withReturn 4363 ns 4362 ns 159875 + +StdFuncMethodCall::withReturn 4338 ns 4337 ns 160163 +ReflectedMethodCall::withReturn 4382 ns 4382 ns 159491 +----------------------------------- +>>> Run 3: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:33:47+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.21, 1.09, 0.88 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3768 ns 3767 ns 186032 +StdFuncCall::noReturn 3753 ns 3753 ns 181678 +ReflectedCall::noReturn 3767 ns 3767 ns 184272 + +StdFuncMethodCall::noReturn 3759 ns 3758 ns 183679 +ReflectedMethodCall::noReturn 3774 ns 3773 ns 184695 +-------------------------------------------------------------------------- +DirectCall::withReturn 4341 ns 4341 ns 160622 +StdFuncCall::withReturn 4356 ns 4355 ns 159689 +ReflectedCall::withReturn 4369 ns 4368 ns 159362 + +StdFuncMethodCall::withReturn 4353 ns 4352 ns 160835 +ReflectedMethodCall::withReturn 4376 ns 4375 ns 159727 +----------------------------------- +>>> Run 4: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:33:58+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.26, 1.11, 0.89 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3755 ns 3754 ns 186615 +StdFuncCall::noReturn 3745 ns 3744 ns 184616 +ReflectedCall::noReturn 3771 ns 3771 ns 185449 + +StdFuncMethodCall::noReturn 3747 ns 3747 ns 186113 +ReflectedMethodCall::noReturn 3773 ns 3772 ns 182904 +-------------------------------------------------------------------------- +DirectCall::withReturn 4325 ns 4323 ns 161325 +StdFuncCall::withReturn 4321 ns 4321 ns 160422 +ReflectedCall::withReturn 4348 ns 4347 ns 159032 + +StdFuncMethodCall::withReturn 4315 ns 4315 ns 159476 +ReflectedMethodCall::withReturn 4363 ns 4362 ns 159343 +----------------------------------- +>>> Run 5: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:34:10+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.22, 1.10, 0.89 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3824 ns 3823 ns 182597 +StdFuncCall::noReturn 3822 ns 3822 ns 182367 +ReflectedCall::noReturn 3835 ns 3835 ns 182224 + +StdFuncMethodCall::noReturn 3820 ns 3820 ns 182550 +ReflectedMethodCall::noReturn 3878 ns 3877 ns 179398 +-------------------------------------------------------------------------- +DirectCall::withReturn 4498 ns 4497 ns 153854 +StdFuncCall::withReturn 4437 ns 4436 ns 157785 +ReflectedCall::withReturn 4484 ns 4483 ns 156149 + +StdFuncMethodCall::withReturn 4469 ns 4467 ns 155734 +ReflectedMethodCall::withReturn 4484 ns 4483 ns 154092 +----------------------------------- +>>> Run 1: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:34:21+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2714.66 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.19, 1.10, 0.89 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4158 ns 4157 ns 168841 +StdFuncCall::noReturn 4107 ns 4107 ns 167421 +ReflectedCall::noReturn 4073 ns 4072 ns 172223 + +StdFuncMethodCall::noReturn 4072 ns 4071 ns 171726 +ReflectedMethodCall::noReturn 4078 ns 4077 ns 171379 +-------------------------------------------------------------------------- +DirectCall::withReturn 4718 ns 4718 ns 148098 +StdFuncCall::withReturn 4703 ns 4702 ns 146865 +ReflectedCall::withReturn 4735 ns 4733 ns 146683 + +StdFuncMethodCall::withReturn 4858 ns 4858 ns 147228 +ReflectedMethodCall::withReturn 4877 ns 4876 ns 135299 +----------------------------------- +>>> Run 2: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:34:33+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4000.23 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.14, 1.09, 0.90 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4149 ns 4149 ns 171540 +StdFuncCall::noReturn 4078 ns 4078 ns 173142 +ReflectedCall::noReturn 4163 ns 4162 ns 172296 + +StdFuncMethodCall::noReturn 4164 ns 4163 ns 171601 +ReflectedMethodCall::noReturn 4206 ns 4206 ns 167024 +-------------------------------------------------------------------------- +DirectCall::withReturn 4803 ns 4802 ns 146401 +StdFuncCall::withReturn 4767 ns 4766 ns 146265 +ReflectedCall::withReturn 4813 ns 4813 ns 144824 + +StdFuncMethodCall::withReturn 4797 ns 4797 ns 144938 +ReflectedMethodCall::withReturn 4842 ns 4841 ns 143714 +----------------------------------- +>>> Run 3: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:34:45+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3428.64 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.20, 1.11, 0.90 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4051 ns 4050 ns 169785 +StdFuncCall::noReturn 4060 ns 4060 ns 171288 +ReflectedCall::noReturn 4069 ns 4067 ns 171269 + +StdFuncMethodCall::noReturn 4037 ns 4036 ns 171130 +ReflectedMethodCall::noReturn 4070 ns 4069 ns 170385 +-------------------------------------------------------------------------- +DirectCall::withReturn 4715 ns 4714 ns 147560 +StdFuncCall::withReturn 4710 ns 4710 ns 147903 +ReflectedCall::withReturn 4732 ns 4730 ns 146870 + +StdFuncMethodCall::withReturn 4706 ns 4705 ns 147200 +ReflectedMethodCall::withReturn 4743 ns 4741 ns 146280 +----------------------------------- +>>> Run 4: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:34:56+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3097.37 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.15, 1.10, 0.91 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4049 ns 4048 ns 172698 +StdFuncCall::noReturn 4028 ns 4028 ns 172826 +ReflectedCall::noReturn 4020 ns 4019 ns 172895 + +StdFuncMethodCall::noReturn 4011 ns 4010 ns 173064 +ReflectedMethodCall::noReturn 4022 ns 4022 ns 167520 +-------------------------------------------------------------------------- +DirectCall::withReturn 4674 ns 4673 ns 149145 +StdFuncCall::withReturn 4664 ns 4663 ns 148506 +ReflectedCall::withReturn 4701 ns 4700 ns 148023 + +StdFuncMethodCall::withReturn 4671 ns 4670 ns 149320 +ReflectedMethodCall::withReturn 4706 ns 4706 ns 148082 +----------------------------------- +>>> Run 5: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:35:08+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1963.71 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.13, 1.10, 0.91 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4035 ns 4035 ns 172990 +StdFuncCall::noReturn 4036 ns 4035 ns 169934 +ReflectedCall::noReturn 4037 ns 4035 ns 173552 + +StdFuncMethodCall::noReturn 4027 ns 4027 ns 173475 +ReflectedMethodCall::noReturn 4046 ns 4046 ns 172800 +-------------------------------------------------------------------------- +DirectCall::withReturn 4683 ns 4682 ns 149053 +StdFuncCall::withReturn 4664 ns 4663 ns 148728 +ReflectedCall::withReturn 4695 ns 4694 ns 148659 + +StdFuncMethodCall::withReturn 4666 ns 4665 ns 148374 +ReflectedMethodCall::withReturn 4716 ns 4715 ns 147755 +----------------------------------- +All benchmarks completed. diff --git a/run_benchmarks.sh b/run_benchmarks.sh new file mode 100755 index 00000000..f2f11c4d --- /dev/null +++ b/run_benchmarks.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Config +BINARY="./bin/RTLBenchmarkApp" +LOGFILE="./benchmark_runs.log" + +# Clear old log file +: > "$LOGFILE" + +echo "Starting benchmark runs..." | tee -a "$LOGFILE" +echo "Binary: $BINARY" | tee -a "$LOGFILE" +echo "Log: $LOGFILE" | tee -a "$LOGFILE" +echo "===================================" | tee -a "$LOGFILE" + +# First handle scale=0, 10 times +SCALE=0 +for i in $(seq 1 10); do + echo ">>> Run $i: workload scale = $SCALE" | tee -a "$LOGFILE" + "$BINARY" "$SCALE" >> "$LOGFILE" 2>&1 + echo "-----------------------------------" | tee -a "$LOGFILE" +done + +# Now handle scales 25, 50, ... 200, each 5 times +for SCALE in $(seq 25 25 200); do + for i in $(seq 1 5); do + echo ">>> Run $i: workload scale = $SCALE" | tee -a "$LOGFILE" + "$BINARY" "$SCALE" >> "$LOGFILE" 2>&1 + echo "-----------------------------------" | tee -a "$LOGFILE" + done +done + +echo "All benchmarks completed." | tee -a "$LOGFILE" From d60c9f3cc726b9a8c32cbab0b45e55c0501917c1 Mon Sep 17 00:00:00 2001 From: neeraj Date: Thu, 11 Sep 2025 00:56:55 +0530 Subject: [PATCH 6/6] benchmarks with functions returning huge std::string. --- .../benchmark_returns_std_string.log | 1655 +++++++++++++++++ 1 file changed, 1655 insertions(+) create mode 100644 benchmarks-stat-log/benchmark_returns_std_string.log diff --git a/benchmarks-stat-log/benchmark_returns_std_string.log b/benchmarks-stat-log/benchmark_returns_std_string.log new file mode 100644 index 00000000..1a714ce3 --- /dev/null +++ b/benchmarks-stat-log/benchmark_returns_std_string.log @@ -0,0 +1,1655 @@ +Starting benchmark runs... +Binary: ./bin/RTLBenchmarkApp +Log: ./benchmark_runs.log +=================================== +>>> Run 1: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:43:11+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4157.05 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 2.65, 1.34, 1.02 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.69 ns 2.69 ns 257512106 +StdFuncCall::noReturn 3.78 ns 3.78 ns 191372055 +ReflectedCall::noReturn 4.75 ns 4.74 ns 150632849 + +StdFuncMethodCall::noReturn 3.37 ns 3.37 ns 205734218 +ReflectedMethodCall::noReturn 8.16 ns 8.15 ns 83185450 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.53 ns 9.52 ns 73618012 +StdFuncCall::withReturn 10.1 ns 10.1 ns 69035901 +ReflectedCall::withReturn 18.9 ns 18.9 ns 36880785 + +StdFuncMethodCall::withReturn 10.1 ns 10.1 ns 69220259 +ReflectedMethodCall::withReturn 22.1 ns 22.1 ns 31879199 +----------------------------------- +>>> Run 2: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:43:21+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2840.42 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 2.40, 1.33, 1.02 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.68 ns 2.68 ns 260488715 +StdFuncCall::noReturn 3.62 ns 3.62 ns 200782884 +ReflectedCall::noReturn 4.56 ns 4.56 ns 148944703 + +StdFuncMethodCall::noReturn 3.39 ns 3.39 ns 208809945 +ReflectedMethodCall::noReturn 8.11 ns 8.10 ns 87050327 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.60 ns 9.60 ns 72996970 +StdFuncCall::withReturn 10.1 ns 10.1 ns 65628479 +ReflectedCall::withReturn 20.2 ns 20.2 ns 35013149 + +StdFuncMethodCall::withReturn 10.4 ns 10.4 ns 65866447 +ReflectedMethodCall::withReturn 23.0 ns 23.0 ns 30671071 +----------------------------------- +>>> Run 3: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:43:30+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4460.24 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 2.18, 1.32, 1.02 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.87 ns 2.87 ns 241103915 +StdFuncCall::noReturn 3.82 ns 3.82 ns 196511816 +ReflectedCall::noReturn 4.81 ns 4.81 ns 146383768 + +StdFuncMethodCall::noReturn 3.44 ns 3.44 ns 203121679 +ReflectedMethodCall::noReturn 8.30 ns 8.29 ns 81544882 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.71 ns 9.70 ns 70716392 +StdFuncCall::withReturn 10.2 ns 10.2 ns 68308824 +ReflectedCall::withReturn 19.1 ns 19.1 ns 35574641 + +StdFuncMethodCall::withReturn 10.4 ns 10.4 ns 67503571 +ReflectedMethodCall::withReturn 22.1 ns 22.1 ns 31856370 +----------------------------------- +>>> Run 4: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:43:40+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3303.29 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 2.15, 1.34, 1.03 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.78 ns 2.78 ns 244476044 +StdFuncCall::noReturn 3.51 ns 3.51 ns 186742133 +ReflectedCall::noReturn 4.72 ns 4.72 ns 145124302 + +StdFuncMethodCall::noReturn 3.71 ns 3.71 ns 195045272 +ReflectedMethodCall::noReturn 8.33 ns 8.32 ns 83825689 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.94 ns 9.94 ns 67349049 +StdFuncCall::withReturn 10.1 ns 10.1 ns 66482926 +ReflectedCall::withReturn 19.2 ns 19.2 ns 36102397 + +StdFuncMethodCall::withReturn 10.1 ns 10.1 ns 67142276 +ReflectedMethodCall::withReturn 22.8 ns 22.8 ns 29914325 +----------------------------------- +>>> Run 5: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:43:49+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1457.53 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 2.21, 1.38, 1.05 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.72 ns 2.72 ns 252082597 +StdFuncCall::noReturn 3.57 ns 3.57 ns 187629241 +ReflectedCall::noReturn 4.85 ns 4.85 ns 145919895 + +StdFuncMethodCall::noReturn 3.47 ns 3.47 ns 205701290 +ReflectedMethodCall::noReturn 8.19 ns 8.19 ns 82512348 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.82 ns 9.82 ns 68734745 +StdFuncCall::withReturn 10.2 ns 10.2 ns 66343231 +ReflectedCall::withReturn 19.1 ns 19.1 ns 36036806 + +StdFuncMethodCall::withReturn 10.1 ns 10.1 ns 66426936 +ReflectedMethodCall::withReturn 21.9 ns 21.9 ns 30764432 +----------------------------------- +>>> Run 6: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:43:59+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4134.64 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 2.10, 1.39, 1.05 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.68 ns 2.68 ns 255151415 +StdFuncCall::noReturn 3.57 ns 3.57 ns 194877796 +ReflectedCall::noReturn 4.68 ns 4.68 ns 148012652 + +StdFuncMethodCall::noReturn 3.41 ns 3.41 ns 203119855 +ReflectedMethodCall::noReturn 8.27 ns 8.27 ns 84231855 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.91 ns 9.91 ns 67237407 +StdFuncCall::withReturn 10.1 ns 10.1 ns 66701430 +ReflectedCall::withReturn 19.0 ns 19.0 ns 35306832 + +StdFuncMethodCall::withReturn 10.1 ns 10.1 ns 66190294 +ReflectedMethodCall::withReturn 22.8 ns 22.8 ns 31433430 +----------------------------------- +>>> Run 7: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:44:08+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3065.25 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 2.01, 1.39, 1.06 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.76 ns 2.75 ns 258152508 +StdFuncCall::noReturn 3.54 ns 3.54 ns 188663322 +ReflectedCall::noReturn 4.70 ns 4.70 ns 148190073 + +StdFuncMethodCall::noReturn 3.48 ns 3.48 ns 204262478 +ReflectedMethodCall::noReturn 8.15 ns 8.15 ns 82688841 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.71 ns 9.71 ns 70719451 +StdFuncCall::withReturn 10.2 ns 10.2 ns 66710422 +ReflectedCall::withReturn 19.2 ns 19.2 ns 35438621 + +StdFuncMethodCall::withReturn 10.1 ns 10.1 ns 64913832 +ReflectedMethodCall::withReturn 22.6 ns 22.5 ns 30465366 +----------------------------------- +>>> Run 8: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:44:17+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4152.63 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.85, 1.38, 1.06 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.70 ns 2.70 ns 258092134 +StdFuncCall::noReturn 3.59 ns 3.59 ns 190138329 +ReflectedCall::noReturn 4.77 ns 4.77 ns 148249878 + +StdFuncMethodCall::noReturn 3.49 ns 3.49 ns 201288659 +ReflectedMethodCall::noReturn 8.16 ns 8.16 ns 81918693 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.91 ns 9.91 ns 70546801 +StdFuncCall::withReturn 10.2 ns 10.2 ns 65288578 +ReflectedCall::withReturn 18.9 ns 18.9 ns 35386904 + +StdFuncMethodCall::withReturn 10.2 ns 10.2 ns 66910973 +ReflectedMethodCall::withReturn 22.8 ns 22.8 ns 30535267 +----------------------------------- +>>> Run 9: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:44:27+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4236.18 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.88, 1.40, 1.07 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2.75 ns 2.75 ns 256627078 +StdFuncCall::noReturn 3.62 ns 3.62 ns 191604367 +ReflectedCall::noReturn 4.90 ns 4.90 ns 146177763 + +StdFuncMethodCall::noReturn 3.51 ns 3.51 ns 207243986 +ReflectedMethodCall::noReturn 8.34 ns 8.34 ns 85440083 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.71 ns 9.71 ns 70073783 +StdFuncCall::withReturn 10.3 ns 10.3 ns 64837520 +ReflectedCall::withReturn 19.2 ns 19.2 ns 36494857 + +StdFuncMethodCall::withReturn 10.2 ns 10.2 ns 64693494 +ReflectedMethodCall::withReturn 22.5 ns 22.5 ns 31231450 +----------------------------------- +>>> Run 10: workload scale = 0 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 0 iterations +============================================= + +2025-09-11T00:44:36+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3410.16 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.80, 1.39, 1.07 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3.18 ns 3.18 ns 220289404 +StdFuncCall::noReturn 3.68 ns 3.68 ns 185037995 +ReflectedCall::noReturn 4.95 ns 4.95 ns 138642595 + +StdFuncMethodCall::noReturn 3.69 ns 3.69 ns 191910140 +ReflectedMethodCall::noReturn 8.40 ns 8.40 ns 82408566 +-------------------------------------------------------------------------- +DirectCall::withReturn 9.78 ns 9.78 ns 68512931 +StdFuncCall::withReturn 10.1 ns 10.1 ns 64820748 +ReflectedCall::withReturn 19.0 ns 19.0 ns 36083173 + +StdFuncMethodCall::withReturn 10.2 ns 10.2 ns 66179461 +ReflectedMethodCall::withReturn 22.4 ns 22.4 ns 31255435 +----------------------------------- +>>> Run 1: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:44:45+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3869.61 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.76, 1.39, 1.07 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 310 ns 310 ns 2254101 +StdFuncCall::noReturn 315 ns 315 ns 2239763 +ReflectedCall::noReturn 316 ns 316 ns 2198780 + +StdFuncMethodCall::noReturn 313 ns 313 ns 2258100 +ReflectedMethodCall::noReturn 323 ns 323 ns 2166074 +-------------------------------------------------------------------------- +DirectCall::withReturn 453 ns 453 ns 1577637 +StdFuncCall::withReturn 452 ns 452 ns 1575065 +ReflectedCall::withReturn 633 ns 633 ns 1064025 + +StdFuncMethodCall::withReturn 452 ns 451 ns 1575285 +ReflectedMethodCall::withReturn 640 ns 640 ns 1059786 +----------------------------------- +>>> Run 2: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:44:56+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3794.29 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.72, 1.40, 1.08 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 317 ns 317 ns 2228177 +StdFuncCall::noReturn 308 ns 308 ns 2227891 +ReflectedCall::noReturn 318 ns 318 ns 2185558 + +StdFuncMethodCall::noReturn 320 ns 320 ns 2209955 +ReflectedMethodCall::noReturn 324 ns 324 ns 2131421 +-------------------------------------------------------------------------- +DirectCall::withReturn 445 ns 445 ns 1580444 +StdFuncCall::withReturn 457 ns 457 ns 1550760 +ReflectedCall::withReturn 633 ns 633 ns 1077338 + +StdFuncMethodCall::withReturn 446 ns 446 ns 1563643 +ReflectedMethodCall::withReturn 646 ns 646 ns 1082286 +----------------------------------- +>>> Run 3: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:45:06+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2203.19 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.77, 1.42, 1.09 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 312 ns 312 ns 2244981 +StdFuncCall::noReturn 308 ns 308 ns 2262484 +ReflectedCall::noReturn 318 ns 318 ns 2253123 + +StdFuncMethodCall::noReturn 312 ns 312 ns 2223455 +ReflectedMethodCall::noReturn 325 ns 325 ns 2208582 +-------------------------------------------------------------------------- +DirectCall::withReturn 515 ns 515 ns 1315012 +StdFuncCall::withReturn 514 ns 514 ns 1314421 +ReflectedCall::withReturn 705 ns 705 ns 996799 + +StdFuncMethodCall::withReturn 518 ns 518 ns 1295521 +ReflectedMethodCall::withReturn 706 ns 706 ns 928961 +----------------------------------- +>>> Run 4: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:45:15+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1438.63 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.72, 1.42, 1.09 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 351 ns 351 ns 2035112 +StdFuncCall::noReturn 349 ns 349 ns 2030713 +ReflectedCall::noReturn 349 ns 349 ns 1980472 + +StdFuncMethodCall::noReturn 349 ns 349 ns 2023659 +ReflectedMethodCall::noReturn 353 ns 353 ns 1978482 +-------------------------------------------------------------------------- +DirectCall::withReturn 510 ns 510 ns 1329271 +StdFuncCall::withReturn 513 ns 513 ns 1337409 +ReflectedCall::withReturn 712 ns 712 ns 931367 + +StdFuncMethodCall::withReturn 511 ns 511 ns 1279105 +ReflectedMethodCall::withReturn 711 ns 711 ns 980263 +----------------------------------- +>>> Run 5: workload scale = 25 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 25 iterations +============================================= + +2025-09-11T00:45:24+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3937.8 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.61, 1.41, 1.09 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 316 ns 316 ns 2233794 +StdFuncCall::noReturn 345 ns 345 ns 2026485 +ReflectedCall::noReturn 354 ns 354 ns 1979604 + +StdFuncMethodCall::noReturn 351 ns 351 ns 1987525 +ReflectedMethodCall::noReturn 363 ns 363 ns 1943031 +-------------------------------------------------------------------------- +DirectCall::withReturn 523 ns 523 ns 1281177 +StdFuncCall::withReturn 522 ns 522 ns 1331638 +ReflectedCall::withReturn 702 ns 702 ns 971089 + +StdFuncMethodCall::withReturn 527 ns 527 ns 1342443 +ReflectedMethodCall::withReturn 707 ns 707 ns 966971 +----------------------------------- +>>> Run 1: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:45:34+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3864.23 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.52, 1.39, 1.09 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 907 ns 906 ns 671085 +StdFuncCall::noReturn 913 ns 913 ns 750555 +ReflectedCall::noReturn 927 ns 927 ns 739691 + +StdFuncMethodCall::noReturn 913 ns 913 ns 734242 +ReflectedMethodCall::noReturn 938 ns 938 ns 722635 +-------------------------------------------------------------------------- +DirectCall::withReturn 1246 ns 1246 ns 536846 +StdFuncCall::withReturn 1268 ns 1268 ns 546493 +ReflectedCall::withReturn 1595 ns 1595 ns 423002 + +StdFuncMethodCall::withReturn 1240 ns 1240 ns 548835 +ReflectedMethodCall::withReturn 1533 ns 1533 ns 444235 +----------------------------------- +>>> Run 2: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:45:42+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4198.35 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.56, 1.40, 1.10 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 897 ns 897 ns 725976 +StdFuncCall::noReturn 907 ns 907 ns 753162 +ReflectedCall::noReturn 928 ns 927 ns 742010 + +StdFuncMethodCall::noReturn 919 ns 919 ns 716837 +ReflectedMethodCall::noReturn 939 ns 939 ns 713611 +-------------------------------------------------------------------------- +DirectCall::withReturn 1199 ns 1199 ns 561452 +StdFuncCall::withReturn 1197 ns 1197 ns 560668 +ReflectedCall::withReturn 1530 ns 1529 ns 426508 + +StdFuncMethodCall::withReturn 1209 ns 1209 ns 556128 +ReflectedMethodCall::withReturn 1540 ns 1540 ns 434049 +----------------------------------- +>>> Run 3: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:45:50+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3711.21 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.47, 1.39, 1.09 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 906 ns 906 ns 730770 +StdFuncCall::noReturn 904 ns 904 ns 752526 +ReflectedCall::noReturn 924 ns 924 ns 717981 + +StdFuncMethodCall::noReturn 899 ns 899 ns 738039 +ReflectedMethodCall::noReturn 923 ns 923 ns 726660 +-------------------------------------------------------------------------- +DirectCall::withReturn 1172 ns 1172 ns 563431 +StdFuncCall::withReturn 1187 ns 1186 ns 559493 +ReflectedCall::withReturn 1525 ns 1525 ns 444023 + +StdFuncMethodCall::withReturn 1180 ns 1180 ns 564379 +ReflectedMethodCall::withReturn 1540 ns 1540 ns 444693 +----------------------------------- +>>> Run 4: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:45:58+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4048.1 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.55, 1.41, 1.10 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 899 ns 899 ns 744944 +StdFuncCall::noReturn 905 ns 905 ns 755918 +ReflectedCall::noReturn 910 ns 910 ns 735203 + +StdFuncMethodCall::noReturn 910 ns 910 ns 751759 +ReflectedMethodCall::noReturn 927 ns 927 ns 718062 +-------------------------------------------------------------------------- +DirectCall::withReturn 1193 ns 1192 ns 571996 +StdFuncCall::withReturn 1196 ns 1196 ns 551911 +ReflectedCall::withReturn 1509 ns 1509 ns 431152 + +StdFuncMethodCall::withReturn 1191 ns 1191 ns 546073 +ReflectedMethodCall::withReturn 1537 ns 1537 ns 441082 +----------------------------------- +>>> Run 5: workload scale = 50 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 50 iterations +============================================= + +2025-09-11T00:46:06+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1023.61 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.51, 1.40, 1.10 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 916 ns 916 ns 732935 +StdFuncCall::noReturn 923 ns 923 ns 738825 +ReflectedCall::noReturn 920 ns 920 ns 716561 + +StdFuncMethodCall::noReturn 909 ns 909 ns 733723 +ReflectedMethodCall::noReturn 939 ns 939 ns 712708 +-------------------------------------------------------------------------- +DirectCall::withReturn 1189 ns 1188 ns 567232 +StdFuncCall::withReturn 1190 ns 1190 ns 556865 +ReflectedCall::withReturn 1531 ns 1531 ns 454023 + +StdFuncMethodCall::withReturn 1187 ns 1187 ns 586934 +ReflectedMethodCall::withReturn 1536 ns 1536 ns 448828 +----------------------------------- +>>> Run 1: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:46:14+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4506.7 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.51, 1.41, 1.11 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1711 ns 1710 ns 397182 +StdFuncCall::noReturn 1701 ns 1701 ns 392625 +ReflectedCall::noReturn 1707 ns 1707 ns 404729 + +StdFuncMethodCall::noReturn 1708 ns 1708 ns 400940 +ReflectedMethodCall::noReturn 1745 ns 1744 ns 393836 +-------------------------------------------------------------------------- +DirectCall::withReturn 2360 ns 2360 ns 296471 +StdFuncCall::withReturn 2358 ns 2358 ns 293315 +ReflectedCall::withReturn 3057 ns 3057 ns 229041 + +StdFuncMethodCall::withReturn 2355 ns 2354 ns 296620 +ReflectedMethodCall::withReturn 3034 ns 3034 ns 227950 +----------------------------------- +>>> Run 2: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:46:23+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1536.93 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.51, 1.41, 1.11 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1746 ns 1746 ns 395262 +StdFuncCall::noReturn 1734 ns 1733 ns 403023 +ReflectedCall::noReturn 1752 ns 1752 ns 380243 + +StdFuncMethodCall::noReturn 1753 ns 1753 ns 388427 +ReflectedMethodCall::noReturn 1752 ns 1751 ns 388074 +-------------------------------------------------------------------------- +DirectCall::withReturn 2395 ns 2395 ns 289058 +StdFuncCall::withReturn 2433 ns 2433 ns 286696 +ReflectedCall::withReturn 3164 ns 3164 ns 221492 + +StdFuncMethodCall::withReturn 2440 ns 2440 ns 281890 +ReflectedMethodCall::withReturn 3166 ns 3166 ns 221117 +----------------------------------- +>>> Run 3: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:46:32+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3018.84 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.43, 1.40, 1.11 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1741 ns 1741 ns 377462 +StdFuncCall::noReturn 1715 ns 1715 ns 398238 +ReflectedCall::noReturn 1722 ns 1721 ns 395238 + +StdFuncMethodCall::noReturn 1740 ns 1740 ns 391977 +ReflectedMethodCall::noReturn 1709 ns 1709 ns 391583 +-------------------------------------------------------------------------- +DirectCall::withReturn 2301 ns 2301 ns 303807 +StdFuncCall::withReturn 2312 ns 2311 ns 300175 +ReflectedCall::withReturn 3073 ns 3073 ns 226573 + +StdFuncMethodCall::withReturn 2423 ns 2423 ns 290465 +ReflectedMethodCall::withReturn 3169 ns 3169 ns 224297 +----------------------------------- +>>> Run 4: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:46:42+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3748.07 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.56, 1.42, 1.12 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1762 ns 1762 ns 388500 +StdFuncCall::noReturn 1755 ns 1754 ns 387350 +ReflectedCall::noReturn 1753 ns 1753 ns 380083 + +StdFuncMethodCall::noReturn 1750 ns 1750 ns 393882 +ReflectedMethodCall::noReturn 1776 ns 1776 ns 391549 +-------------------------------------------------------------------------- +DirectCall::withReturn 2401 ns 2400 ns 295056 +StdFuncCall::withReturn 2397 ns 2397 ns 295309 +ReflectedCall::withReturn 3079 ns 3079 ns 222199 + +StdFuncMethodCall::withReturn 2409 ns 2409 ns 282929 +ReflectedMethodCall::withReturn 3179 ns 3179 ns 223918 +----------------------------------- +>>> Run 5: workload scale = 75 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 75 iterations +============================================= + +2025-09-11T00:46:51+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1163.73 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.63, 1.44, 1.13 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1723 ns 1722 ns 384064 +StdFuncCall::noReturn 1737 ns 1737 ns 391656 +ReflectedCall::noReturn 1731 ns 1730 ns 386459 + +StdFuncMethodCall::noReturn 1733 ns 1733 ns 397046 +ReflectedMethodCall::noReturn 1737 ns 1737 ns 395967 +-------------------------------------------------------------------------- +DirectCall::withReturn 2369 ns 2369 ns 291883 +StdFuncCall::withReturn 2372 ns 2371 ns 291833 +ReflectedCall::withReturn 3078 ns 3078 ns 228938 + +StdFuncMethodCall::withReturn 2363 ns 2363 ns 291230 +ReflectedMethodCall::withReturn 3115 ns 3115 ns 224035 +----------------------------------- +>>> Run 1: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:47:01+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4500 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.60, 1.44, 1.13 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1980 ns 1979 ns 351441 +StdFuncCall::noReturn 1949 ns 1949 ns 354766 +ReflectedCall::noReturn 1986 ns 1986 ns 347476 + +StdFuncMethodCall::noReturn 1961 ns 1960 ns 344503 +ReflectedMethodCall::noReturn 1994 ns 1993 ns 343757 +-------------------------------------------------------------------------- +DirectCall::withReturn 3012 ns 3011 ns 236164 +StdFuncCall::withReturn 2976 ns 2976 ns 235449 +ReflectedCall::withReturn 3916 ns 3916 ns 184109 + +StdFuncMethodCall::withReturn 3026 ns 3026 ns 229148 +ReflectedMethodCall::withReturn 3878 ns 3878 ns 181123 +----------------------------------- +>>> Run 2: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:47:11+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3869.01 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.59, 1.45, 1.14 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1973 ns 1973 ns 343831 +StdFuncCall::noReturn 1967 ns 1966 ns 336873 +ReflectedCall::noReturn 1989 ns 1989 ns 348169 + +StdFuncMethodCall::noReturn 1988 ns 1988 ns 348304 +ReflectedMethodCall::noReturn 2012 ns 2012 ns 335265 +-------------------------------------------------------------------------- +DirectCall::withReturn 3000 ns 3000 ns 230973 +StdFuncCall::withReturn 2967 ns 2966 ns 232757 +ReflectedCall::withReturn 3876 ns 3876 ns 183695 + +StdFuncMethodCall::withReturn 3027 ns 3027 ns 232206 +ReflectedMethodCall::withReturn 3816 ns 3815 ns 182478 +----------------------------------- +>>> Run 3: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:47:20+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4509.87 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.58, 1.45, 1.14 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1987 ns 1987 ns 344531 +StdFuncCall::noReturn 1974 ns 1974 ns 339319 +ReflectedCall::noReturn 1991 ns 1990 ns 341989 + +StdFuncMethodCall::noReturn 1991 ns 1991 ns 345119 +ReflectedMethodCall::noReturn 1994 ns 1993 ns 350809 +-------------------------------------------------------------------------- +DirectCall::withReturn 3024 ns 3023 ns 236080 +StdFuncCall::withReturn 2991 ns 2990 ns 234932 +ReflectedCall::withReturn 3841 ns 3841 ns 182164 + +StdFuncMethodCall::withReturn 2949 ns 2948 ns 237674 +ReflectedMethodCall::withReturn 3890 ns 3890 ns 180491 +----------------------------------- +>>> Run 4: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:47:30+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2443.13 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.57, 1.45, 1.14 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1974 ns 1974 ns 347223 +StdFuncCall::noReturn 1973 ns 1972 ns 348490 +ReflectedCall::noReturn 1994 ns 1994 ns 345264 + +StdFuncMethodCall::noReturn 1940 ns 1939 ns 343663 +ReflectedMethodCall::noReturn 2003 ns 2003 ns 348942 +-------------------------------------------------------------------------- +DirectCall::withReturn 2965 ns 2965 ns 237170 +StdFuncCall::withReturn 2913 ns 2913 ns 238241 +ReflectedCall::withReturn 3852 ns 3852 ns 184604 + +StdFuncMethodCall::withReturn 2915 ns 2915 ns 237691 +ReflectedMethodCall::withReturn 3782 ns 3782 ns 185705 +----------------------------------- +>>> Run 5: workload scale = 100 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 100 iterations +============================================= + +2025-09-11T00:47:40+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4409.93 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.56, 1.45, 1.15 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 1982 ns 1982 ns 351034 +StdFuncCall::noReturn 1964 ns 1964 ns 341721 +ReflectedCall::noReturn 1989 ns 1988 ns 350068 + +StdFuncMethodCall::noReturn 1955 ns 1954 ns 348141 +ReflectedMethodCall::noReturn 2003 ns 2003 ns 342525 +-------------------------------------------------------------------------- +DirectCall::withReturn 2953 ns 2953 ns 234331 +StdFuncCall::withReturn 2934 ns 2934 ns 238160 +ReflectedCall::withReturn 3811 ns 3810 ns 186625 + +StdFuncMethodCall::withReturn 2912 ns 2912 ns 236835 +ReflectedMethodCall::withReturn 3899 ns 3898 ns 184770 +----------------------------------- +>>> Run 1: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:47:50+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4575.95 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.63, 1.47, 1.16 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2187 ns 2187 ns 313314 +StdFuncCall::noReturn 2203 ns 2202 ns 310954 +ReflectedCall::noReturn 2231 ns 2231 ns 314343 + +StdFuncMethodCall::noReturn 2218 ns 2217 ns 308543 +ReflectedMethodCall::noReturn 2262 ns 2262 ns 307479 +-------------------------------------------------------------------------- +DirectCall::withReturn 3654 ns 3654 ns 191381 +StdFuncCall::withReturn 3651 ns 3650 ns 193595 +ReflectedCall::withReturn 4748 ns 4747 ns 151401 + +StdFuncMethodCall::withReturn 3605 ns 3605 ns 194245 +ReflectedMethodCall::withReturn 4691 ns 4690 ns 152913 +----------------------------------- +>>> Run 2: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:48:01+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4523.6 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.69, 1.49, 1.17 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2236 ns 2236 ns 309724 +StdFuncCall::noReturn 2214 ns 2214 ns 315329 +ReflectedCall::noReturn 2236 ns 2236 ns 309095 + +StdFuncMethodCall::noReturn 2217 ns 2217 ns 304364 +ReflectedMethodCall::noReturn 2247 ns 2247 ns 313155 +-------------------------------------------------------------------------- +DirectCall::withReturn 3592 ns 3592 ns 195293 +StdFuncCall::withReturn 3587 ns 3587 ns 194462 +ReflectedCall::withReturn 4691 ns 4691 ns 152353 + +StdFuncMethodCall::withReturn 3594 ns 3594 ns 196395 +ReflectedMethodCall::withReturn 4737 ns 4737 ns 151845 +----------------------------------- +>>> Run 3: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:48:11+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 799.56 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.73, 1.50, 1.18 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2237 ns 2237 ns 301530 +StdFuncCall::noReturn 2248 ns 2248 ns 305381 +ReflectedCall::noReturn 2234 ns 2233 ns 307334 + +StdFuncMethodCall::noReturn 2250 ns 2249 ns 289243 +ReflectedMethodCall::noReturn 2241 ns 2241 ns 308428 +-------------------------------------------------------------------------- +DirectCall::withReturn 3685 ns 3684 ns 190114 +StdFuncCall::withReturn 3669 ns 3668 ns 190878 +ReflectedCall::withReturn 4782 ns 4782 ns 150076 + +StdFuncMethodCall::withReturn 3606 ns 3606 ns 191373 +ReflectedMethodCall::withReturn 4723 ns 4722 ns 152622 +----------------------------------- +>>> Run 4: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:48:22+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2959.43 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.77, 1.52, 1.19 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2182 ns 2182 ns 307571 +StdFuncCall::noReturn 2184 ns 2183 ns 313459 +ReflectedCall::noReturn 2205 ns 2205 ns 317597 + +StdFuncMethodCall::noReturn 2224 ns 2223 ns 310829 +ReflectedMethodCall::noReturn 2235 ns 2235 ns 303977 +-------------------------------------------------------------------------- +DirectCall::withReturn 3643 ns 3642 ns 195401 +StdFuncCall::withReturn 3554 ns 3554 ns 196445 +ReflectedCall::withReturn 4606 ns 4605 ns 154556 + +StdFuncMethodCall::withReturn 3581 ns 3581 ns 195507 +ReflectedMethodCall::withReturn 4713 ns 4713 ns 152328 +----------------------------------- +>>> Run 5: workload scale = 125 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 125 iterations +============================================= + +2025-09-11T00:48:32+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3933.71 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.90, 1.56, 1.20 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 2204 ns 2204 ns 305118 +StdFuncCall::noReturn 2204 ns 2204 ns 319369 +ReflectedCall::noReturn 2209 ns 2208 ns 314425 + +StdFuncMethodCall::noReturn 2226 ns 2226 ns 305314 +ReflectedMethodCall::noReturn 2220 ns 2220 ns 310974 +-------------------------------------------------------------------------- +DirectCall::withReturn 3649 ns 3648 ns 195704 +StdFuncCall::withReturn 3665 ns 3664 ns 193630 +ReflectedCall::withReturn 4598 ns 4598 ns 152357 + +StdFuncMethodCall::withReturn 3629 ns 3628 ns 195927 +ReflectedMethodCall::withReturn 4805 ns 4805 ns 154283 +----------------------------------- +>>> Run 1: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:48:43+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2671.41 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.92, 1.58, 1.21 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3533 ns 3533 ns 195180 +StdFuncCall::noReturn 3546 ns 3545 ns 195924 +ReflectedCall::noReturn 3625 ns 3625 ns 195820 + +StdFuncMethodCall::noReturn 3629 ns 3629 ns 197819 +ReflectedMethodCall::noReturn 3626 ns 3626 ns 195755 +-------------------------------------------------------------------------- +DirectCall::withReturn 5182 ns 5181 ns 131107 +StdFuncCall::withReturn 5141 ns 5140 ns 130322 +ReflectedCall::withReturn 6380 ns 6380 ns 107050 + +StdFuncMethodCall::withReturn 5139 ns 5137 ns 130221 +ReflectedMethodCall::withReturn 6283 ns 6283 ns 109882 +----------------------------------- +>>> Run 2: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:48:52+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1153.89 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.92, 1.58, 1.22 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3645 ns 3644 ns 194763 +StdFuncCall::noReturn 3536 ns 3536 ns 197643 +ReflectedCall::noReturn 3549 ns 3549 ns 197667 + +StdFuncMethodCall::noReturn 3535 ns 3534 ns 197002 +ReflectedMethodCall::noReturn 3554 ns 3553 ns 196119 +-------------------------------------------------------------------------- +DirectCall::withReturn 5181 ns 5181 ns 135659 +StdFuncCall::withReturn 5179 ns 5178 ns 133046 +ReflectedCall::withReturn 6373 ns 6371 ns 109310 + +StdFuncMethodCall::withReturn 5177 ns 5176 ns 132606 +ReflectedMethodCall::withReturn 6372 ns 6372 ns 109258 +----------------------------------- +>>> Run 3: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:49:01+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.93, 1.60, 1.23 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3528 ns 3528 ns 197592 +StdFuncCall::noReturn 3510 ns 3510 ns 191078 +ReflectedCall::noReturn 3526 ns 3526 ns 197562 + +StdFuncMethodCall::noReturn 3514 ns 3513 ns 198411 +ReflectedMethodCall::noReturn 3730 ns 3730 ns 196892 +-------------------------------------------------------------------------- +DirectCall::withReturn 5354 ns 5352 ns 123800 +StdFuncCall::withReturn 5245 ns 5244 ns 136768 +ReflectedCall::withReturn 6398 ns 6397 ns 106337 + +StdFuncMethodCall::withReturn 5175 ns 5175 ns 131618 +ReflectedMethodCall::withReturn 6289 ns 6287 ns 110758 +----------------------------------- +>>> Run 4: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:49:10+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2161.83 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.87, 1.59, 1.23 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3542 ns 3541 ns 198073 +StdFuncCall::noReturn 3610 ns 3609 ns 195386 +ReflectedCall::noReturn 3583 ns 3582 ns 195941 + +StdFuncMethodCall::noReturn 3507 ns 3506 ns 199751 +ReflectedMethodCall::noReturn 3609 ns 3608 ns 195357 +-------------------------------------------------------------------------- +DirectCall::withReturn 5074 ns 5073 ns 137709 +StdFuncCall::withReturn 5121 ns 5120 ns 136175 +ReflectedCall::withReturn 6347 ns 6346 ns 107908 + +StdFuncMethodCall::withReturn 5089 ns 5088 ns 132717 +ReflectedMethodCall::withReturn 6358 ns 6358 ns 111927 +----------------------------------- +>>> Run 5: workload scale = 150 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 150 iterations +============================================= + +2025-09-11T00:49:20+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 1932.44 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.73, 1.57, 1.23 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3578 ns 3577 ns 198985 +StdFuncCall::noReturn 3533 ns 3532 ns 198881 +ReflectedCall::noReturn 3517 ns 3517 ns 198702 + +StdFuncMethodCall::noReturn 3572 ns 3572 ns 198500 +ReflectedMethodCall::noReturn 3572 ns 3572 ns 185939 +-------------------------------------------------------------------------- +DirectCall::withReturn 5046 ns 5046 ns 137950 +StdFuncCall::withReturn 5080 ns 5078 ns 138211 +ReflectedCall::withReturn 6306 ns 6304 ns 110192 + +StdFuncMethodCall::withReturn 5132 ns 5132 ns 131855 +ReflectedMethodCall::withReturn 6343 ns 6343 ns 107271 +----------------------------------- +>>> Run 1: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:49:29+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2271.38 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.62, 1.55, 1.22 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3789 ns 3788 ns 183993 +StdFuncCall::noReturn 3777 ns 3776 ns 185241 +ReflectedCall::noReturn 3781 ns 3780 ns 183887 + +StdFuncMethodCall::noReturn 3778 ns 3777 ns 185194 +ReflectedMethodCall::noReturn 3815 ns 3814 ns 183316 +-------------------------------------------------------------------------- +DirectCall::withReturn 5771 ns 5770 ns 121611 +StdFuncCall::withReturn 5735 ns 5734 ns 117886 +ReflectedCall::withReturn 7182 ns 7182 ns 94871 + +StdFuncMethodCall::withReturn 5796 ns 5795 ns 116975 +ReflectedMethodCall::withReturn 7194 ns 7193 ns 94083 +----------------------------------- +>>> Run 2: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:49:38+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2817.81 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.52, 1.54, 1.22 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3877 ns 3877 ns 180661 +StdFuncCall::noReturn 3876 ns 3876 ns 181752 +ReflectedCall::noReturn 3864 ns 3864 ns 180348 + +StdFuncMethodCall::noReturn 3914 ns 3914 ns 180868 +ReflectedMethodCall::noReturn 3853 ns 3853 ns 179813 +-------------------------------------------------------------------------- +DirectCall::withReturn 5826 ns 5826 ns 120405 +StdFuncCall::withReturn 5768 ns 5768 ns 120615 +ReflectedCall::withReturn 7147 ns 7147 ns 97322 + +StdFuncMethodCall::withReturn 5783 ns 5783 ns 120537 +ReflectedMethodCall::withReturn 7177 ns 7176 ns 96515 +----------------------------------- +>>> Run 3: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:49:48+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2468.99 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.44, 1.52, 1.22 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3867 ns 3866 ns 184722 +StdFuncCall::noReturn 3813 ns 3813 ns 182052 +ReflectedCall::noReturn 3799 ns 3799 ns 183532 + +StdFuncMethodCall::noReturn 3901 ns 3901 ns 180895 +ReflectedMethodCall::noReturn 3821 ns 3820 ns 180911 +-------------------------------------------------------------------------- +DirectCall::withReturn 5694 ns 5694 ns 122739 +StdFuncCall::withReturn 5726 ns 5726 ns 122179 +ReflectedCall::withReturn 7126 ns 7125 ns 99356 + +StdFuncMethodCall::withReturn 5669 ns 5669 ns 120489 +ReflectedMethodCall::withReturn 7014 ns 7013 ns 94851 +----------------------------------- +>>> Run 4: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:49:57+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 800 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.37, 1.50, 1.21 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3811 ns 3811 ns 185570 +StdFuncCall::noReturn 4045 ns 4045 ns 173991 +ReflectedCall::noReturn 3913 ns 3913 ns 178008 + +StdFuncMethodCall::noReturn 3858 ns 3858 ns 180877 +ReflectedMethodCall::noReturn 3897 ns 3897 ns 181085 +-------------------------------------------------------------------------- +DirectCall::withReturn 5706 ns 5706 ns 118455 +StdFuncCall::withReturn 5694 ns 5693 ns 119512 +ReflectedCall::withReturn 7093 ns 7093 ns 95014 + +StdFuncMethodCall::withReturn 5716 ns 5715 ns 117328 +ReflectedMethodCall::withReturn 7107 ns 7107 ns 92531 +----------------------------------- +>>> Run 5: workload scale = 175 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 175 iterations +============================================= + +2025-09-11T00:50:07+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 2389.7 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.34, 1.49, 1.21 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 3823 ns 3822 ns 184164 +StdFuncCall::noReturn 3921 ns 3920 ns 184054 +ReflectedCall::noReturn 3892 ns 3892 ns 181641 + +StdFuncMethodCall::noReturn 3917 ns 3917 ns 182002 +ReflectedMethodCall::noReturn 3937 ns 3937 ns 179719 +-------------------------------------------------------------------------- +DirectCall::withReturn 5706 ns 5706 ns 116926 +StdFuncCall::withReturn 5727 ns 5726 ns 122669 +ReflectedCall::withReturn 7154 ns 7153 ns 92948 + +StdFuncMethodCall::withReturn 5696 ns 5695 ns 117101 +ReflectedMethodCall::withReturn 7157 ns 7157 ns 94837 +----------------------------------- +>>> Run 1: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:50:16+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3209.87 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.37, 1.49, 1.22 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4196 ns 4196 ns 170841 +StdFuncCall::noReturn 4197 ns 4197 ns 171474 +ReflectedCall::noReturn 4213 ns 4213 ns 167685 + +StdFuncMethodCall::noReturn 4195 ns 4195 ns 169093 +ReflectedMethodCall::noReturn 4235 ns 4235 ns 167817 +-------------------------------------------------------------------------- +DirectCall::withReturn 6403 ns 6401 ns 105705 +StdFuncCall::withReturn 6411 ns 6409 ns 104979 +ReflectedCall::withReturn 7984 ns 7982 ns 83508 + +StdFuncMethodCall::withReturn 6531 ns 6529 ns 106182 +ReflectedMethodCall::withReturn 7987 ns 7986 ns 83759 +----------------------------------- +>>> Run 2: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:50:26+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4359.42 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.47, 1.51, 1.22 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4189 ns 4188 ns 170733 +StdFuncCall::noReturn 4075 ns 4073 ns 173783 +ReflectedCall::noReturn 4062 ns 4062 ns 172155 + +StdFuncMethodCall::noReturn 4036 ns 4036 ns 172871 +ReflectedMethodCall::noReturn 4156 ns 4156 ns 171048 +-------------------------------------------------------------------------- +DirectCall::withReturn 6255 ns 6255 ns 107881 +StdFuncCall::withReturn 6202 ns 6201 ns 111269 +ReflectedCall::withReturn 7732 ns 7731 ns 88927 + +StdFuncMethodCall::withReturn 6237 ns 6237 ns 108573 +ReflectedMethodCall::withReturn 7717 ns 7716 ns 87408 +----------------------------------- +>>> Run 3: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:50:35+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3349.71 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.47, 1.51, 1.23 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4183 ns 4182 ns 172969 +StdFuncCall::noReturn 4158 ns 4158 ns 169661 +ReflectedCall::noReturn 4320 ns 4320 ns 167031 + +StdFuncMethodCall::noReturn 4142 ns 4142 ns 171242 +ReflectedMethodCall::noReturn 4244 ns 4243 ns 167943 +-------------------------------------------------------------------------- +DirectCall::withReturn 6215 ns 6214 ns 107561 +StdFuncCall::withReturn 6285 ns 6284 ns 106520 +ReflectedCall::withReturn 7794 ns 7794 ns 86470 + +StdFuncMethodCall::withReturn 6259 ns 6257 ns 109244 +ReflectedMethodCall::withReturn 7877 ns 7876 ns 83397 +----------------------------------- +>>> Run 4: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:50:45+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 4518.55 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.56, 1.52, 1.24 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4097 ns 4097 ns 172402 +StdFuncCall::noReturn 4102 ns 4102 ns 171446 +ReflectedCall::noReturn 4218 ns 4217 ns 171091 + +StdFuncMethodCall::noReturn 4080 ns 4080 ns 170058 +ReflectedMethodCall::noReturn 4114 ns 4114 ns 170617 +-------------------------------------------------------------------------- +DirectCall::withReturn 6368 ns 6367 ns 109122 +StdFuncCall::withReturn 6411 ns 6410 ns 104101 +ReflectedCall::withReturn 8033 ns 8032 ns 86564 + +StdFuncMethodCall::withReturn 6449 ns 6448 ns 103769 +ReflectedMethodCall::withReturn 8047 ns 8047 ns 82650 +----------------------------------- +>>> Run 5: workload scale = 200 + +======== RTL Benchmark Configuration ======== +Workload: concatenate string of length 500 +Scale : 200 iterations +============================================= + +2025-09-11T00:50:55+05:30 +Running ./bin/RTLBenchmarkApp +Run on (16 X 3507.94 MHz CPU s) +CPU Caches: + L1 Data 48 KiB (x8) + L1 Instruction 32 KiB (x8) + L2 Unified 1280 KiB (x8) + L3 Unified 20480 KiB (x1) +Load Average: 1.55, 1.52, 1.24 +-------------------------------------------------------------------------- +Benchmark Time CPU Iterations +-------------------------------------------------------------------------- +DirectCall::noReturn 4065 ns 4065 ns 171561 +StdFuncCall::noReturn 4084 ns 4084 ns 174097 +ReflectedCall::noReturn 4206 ns 4205 ns 172296 + +StdFuncMethodCall::noReturn 4229 ns 4229 ns 173534 +ReflectedMethodCall::noReturn 4068 ns 4068 ns 171180 +-------------------------------------------------------------------------- +DirectCall::withReturn 6278 ns 6277 ns 111032 +StdFuncCall::withReturn 6352 ns 6351 ns 106040 +ReflectedCall::withReturn 7900 ns 7898 ns 87218 + +StdFuncMethodCall::withReturn 6349 ns 6349 ns 110877 +ReflectedMethodCall::withReturn 7880 ns 7878 ns 84629 +----------------------------------- +All benchmarks completed.