Skip to content

Commit f008cc0

Browse files
authored
BenchMark Stats
- Raw BenchMark on linux logs. - BenchMark on ARM report.
2 parents 4688d7b + 4e215c9 commit f008cc0

File tree

6 files changed

+875
-71
lines changed

6 files changed

+875
-71
lines changed

BenchMarkReport_0.md

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
RTL Benchmarking Analysis Report
2+
3+
Date: 2025-09-08
4+
Platform: Android tablet running Ubuntu via Turmax VM
5+
CPU: 8 cores @ 1804.8 MHz
6+
VM Environment: Ubuntu inside Turmax app
7+
Load Average During Benchmarks: 3.9–6.9
8+
Note: CPU scaling enabled; real-time measurements may include slight noise.
9+
10+
11+
---
12+
13+
1. Benchmark Setup
14+
15+
All benchmarks measure call dispatch time for various call types under different workloads:
16+
17+
Direct Call: Native C++ function calls.
18+
19+
std::function Call: Calls wrapped in std::function.
20+
21+
std::function Method Call: Member functions wrapped in std::function.
22+
23+
Reflected Call: RTL reflection free function dispatch.
24+
25+
Reflected Method Call: RTL reflection method dispatch.
26+
27+
28+
Two variants measured:
29+
30+
No-Return: Functions with void return type.
31+
32+
With-Return: Functions returning a value.
33+
34+
35+
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.
36+
37+
38+
---
39+
40+
2. OS & Platform Context
41+
42+
Android environment running Ubuntu via Turmax VM introduces:
43+
44+
CPU scheduling variability
45+
46+
CPU frequency scaling
47+
48+
Minor memory virtualization overhead
49+
50+
51+
Despite this, benchmark results are stable and reproducible, with only small variations across runs (~2–5%).
52+
53+
Load averages during tests were moderate-to-high (3.9–6.9), confirming RTL performance is robust under system stress.
54+
55+
56+
57+
---
58+
59+
3. Benchmark Results Summary
60+
61+
3.1 No-Return Calls
62+
63+
Call Type Time Range (ns) Overhead vs Direct
64+
65+
Direct Call 106–1176 0%
66+
std::function 108–1448 5–23%
67+
std::function Method 113–1247 7–10%
68+
Reflected Call 110–1234 8–10%
69+
Reflected Method 120–1260 10–14%
70+
71+
72+
Observations:
73+
74+
Reflection overhead is modest and predictable.
75+
76+
Reflected free calls scale well, occasionally slightly cheaper than direct calls due to CPU cache effects.
77+
78+
Method calls are ~10–14% slower than direct calls at peak workload.
79+
80+
81+
3.2 With-Return Calls
82+
83+
Call Type Time Range (ns) Overhead vs Direct
84+
85+
Direct Call 133–1292 0%
86+
std::function 135–1296 0–5%
87+
std::function Method 143–1300 0–4%
88+
Reflected Call 177–1345 3–6%
89+
Reflected Method 192–1376 5–10%
90+
91+
92+
Observations:
93+
94+
Return value dispatch adds ~50–80 ns per call consistently.
95+
96+
Reflected methods with return are the heaviest, but overhead remains bounded below 10%.
97+
98+
Scaling is linear even at extreme workloads (hundreds of thousands of calls in µs range).
99+
100+
101+
102+
---
103+
104+
4. Scaling Insights
105+
106+
1. Direct and std::function calls scale linearly with workload; predictable performance.
107+
108+
109+
2. Reflected calls scale well — overhead remains bounded, even at ultra-heavy call frequencies (~1+ µs/call).
110+
111+
112+
3. Methods cost slightly more than free functions (~10%), consistent across workload.
113+
114+
115+
4. Return-value functions consistently add ~50–80 ns, regardless of workload.
116+
117+
118+
5. Minor run-to-run variation is attributable to VM CPU scheduling and frequency scaling, not RTL inefficiency.
119+
120+
121+
122+
123+
---
124+
125+
5. Implications for RTL Usage
126+
127+
Dynamic Workloads: Reflection can safely handle millions of calls without becoming a bottleneck.
128+
129+
Game Engines / Scripting / Tooling: RTL is suitable for runtime event dispatch, editor tooling, and serialization/deserialization tasks.
130+
131+
Micro-optimization: For extremely hot loops (<10 ns per call), direct calls or std::function may still be preferred.
132+
133+
Overall: RTL provides a balanced tradeoff between dynamic flexibility and runtime performance.
134+
135+
136+
137+
---
138+
139+
6. Conclusion
140+
141+
RTL reflection overhead is modest and predictable:
142+
143+
~5–10% for free function reflection
144+
145+
~10–14% for method reflection
146+
147+
Return-value adds ~50–80 ns consistently
148+
149+
150+
Even in heavy workloads (~1 µs per call), reflection remains viable for high-frequency dynamic systems.
151+
152+
This confirms RTL’s practicality in real-world applications, including heavy scripting, runtime tools, and editor-driven dynamic systems.
153+
154+

0 commit comments

Comments
 (0)