Skip to content

Commit 722db39

Browse files
committed
benchmarking script added.
1 parent 9d3e403 commit 722db39

File tree

11 files changed

+1873
-976
lines changed

11 files changed

+1873
-976
lines changed

BenchMarkReports/BenchMarkReport_arm.md

Lines changed: 0 additions & 154 deletions
This file was deleted.

BenchMarkReports/rtl-bm-raw-logs-linux.txt

Lines changed: 0 additions & 693 deletions
This file was deleted.

RTLBenchmarkApp/src/BenchMark.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
77
#include "BenchMark.h"
88

99
extern std::size_t g_work_load_scale;
10+
extern std::optional<std::string> g_work_done;
1011

1112
namespace
1213
{
13-
static void work_load(bm::argStr_t& pMsg)
14+
NOINLINE static std::string work_load(bm::argStr_t& pMsg)
1415
{
15-
bm::g_msg = std::string();
16+
auto workStr = std::string();
1617
for(int i = 0; i < g_work_load_scale; ++i)
1718
{
18-
bm::g_msg->append(pMsg);
19+
workStr += pMsg;
1920
}
21+
return workStr;
2022
}
2123
}
2224

@@ -27,32 +29,33 @@ namespace bm
2729
{
2830
volatile auto* p = &pMsg;
2931
static_cast<void>(p);
30-
work_load(pMsg);
32+
33+
g_work_done = work_load(pMsg);
3134
}
3235

33-
34-
NOINLINE retStr_t getMessage(argStr_t pMsg)
36+
NOINLINE void Node::sendMessage(argStr_t pMsg)
3537
{
3638
volatile auto* p = &pMsg;
3739
static_cast<void>(p);
38-
work_load(pMsg);
39-
return bm::retStr_t(bm::g_msg->c_str());
40-
}
4140

41+
g_work_done = work_load(pMsg);
42+
}
4243

43-
NOINLINE void Node::sendMessage(argStr_t pMsg)
44+
NOINLINE retStr_t getMessage(argStr_t pMsg)
4445
{
4546
volatile auto* p = &pMsg;
4647
static_cast<void>(p);
47-
work_load(pMsg);
48-
}
4948

49+
g_work_done = work_load(pMsg);
50+
return bm::retStr_t(g_work_done->c_str());
51+
}
5052

5153
NOINLINE retStr_t Node::getMessage(argStr_t pMsg)
5254
{
5355
volatile auto* p = &pMsg;
5456
static_cast<void>(p);
55-
work_load(pMsg);
56-
return bm::retStr_t(bm::g_msg->c_str());
57+
58+
g_work_done = work_load(pMsg);
59+
return bm::retStr_t(g_work_done->c_str());
5760
}
5861
}

RTLBenchmarkApp/src/BenchMark.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ namespace bm
1919
using argStr_t = std::string_view;
2020
using retStr_t = std::string_view;
2121

22-
static const char* LONG_STR = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do"
23-
"do aeiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis"
22+
static const char* LONG_STR = "Lorem ipsum"
23+
"dolor sit amet, consectetur adipiscing elit, sed do"
24+
"do aeiusmod tempor incididunt uth labore et dolore magna aliqua. Ut enim ad minim veniam, quis"
2425
"nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure"
2526
"dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Except"
2627
"eur ssint occaecat cupidatat nnon proident, sunt in culpa qui officia deserunt mollit anim id"
@@ -36,6 +37,4 @@ namespace bm
3637

3738
extern void sendMessage(argStr_t);
3839
extern retStr_t getMessage(argStr_t);
39-
40-
static std::optional<std::string> g_msg;
4140
}

0 commit comments

Comments
 (0)