Skip to content

Commit d2938c9

Browse files
committed
Updated benchmark for linux
1 parent 35378d6 commit d2938c9

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Notes:
167167

168168
Labels are the same as in the comparison spreadsheet. The speed benchmarks were compiled with all optimizations turned on (except LTO). Speed is measured relative to `std::unique_ptr<T>` used as owner pointer, and `T*` used as observer pointer, which should be the fastest possible implementation (but obviously the one with least safety).
169169

170-
You can run the benchmarks yourself, they are located in `tests/speed_benchmark.cpp`. The benchmark executable runs tests for three object types: `int`, `float`, `std::string`, and `std::array<int,65'536>`, to simulate objects of various allocation cost. The timings below are the worst-case values measured across all object types, which should be most relevant to highlight the overhead from the pointer itself (and erases flukes from the benchmarking framework). In real life scenarios, the actual measured overhead will be substantially lower, as actual business logic is likely to dominate the time budget.
170+
You can run the benchmarks yourself, they are located in `tests/speed_benchmark.cpp`. The benchmark executable runs tests for three object types: `int`, `float`, `std::string`, and `std::array<int,65'536>`, to simulate objects of various allocation cost. The timings below are the median values measured across all object types, which should be most relevant to highlight the overhead from the pointer itself (and erases flukes from the benchmarking framework). In real life scenarios, the actual measured overhead will be substantially lower, as actual business logic is likely to dominate the time budget.
171171

172172
Detail of the benchmarks:
173173
- Create owner empty: default-construct an owner pointer (to nullptr).
@@ -179,22 +179,20 @@ Detail of the benchmarks:
179179
- Create observer copy: construct a new observer pointer from another observer pointer.
180180
- Dereference observer: get a reference to the underlying object from an observer pointer.
181181

182-
The benchmarks were last ran for v0.4.0.
182+
*Compiler: gcc 9.4.0, std: libstdc++-9, oup: 0.7.1, OS: linux 5.15.0, CPU: Ryzen 5 2600:*
183183

184-
*Compiler: gcc 9.3.0, std: libstdc++, OS: linux 5.1.0, CPU: Ryzen 5 2600:*
184+
| Pointer | raw/unique | weak/shared | observer/obs_unique | observer/obs_sealed |
185+
| --- | --- | --- | --- | --- |
186+
| Create owner empty | 1 | 1.0 | 1.0 | 1.1 |
187+
| Create owner | 1 | 2.1 | 1.7 | N/A |
188+
| Create owner factory | 1 | 1.3 | 1.7 | 1.4 |
189+
| Dereference owner | 1 | 1.1 | 1.0 | 1.0 |
190+
| Create observer empty | 1 | 1.3 | 1.2 | 1.2 |
191+
| Create observer | 1 | 1.7 | 1.6 | 1.6 |
192+
| Create observer copy | 1 | 1.6 | 1.6 | 1.8 |
193+
| Dereference observer | 1 | 3.9 | 1.1 | 1.1 |
185194

186-
| Pointer | raw/unique | weak/shared | observer/obs_unique | observer/obs_sealed |
187-
|--------------------------|------------|-------------|---------------------|---------------------|
188-
| Create owner empty | 1 | 1.1 | 1.1 | 1.1 |
189-
| Create owner | 1 | 2.2 | 1.9 | N/A |
190-
| Create owner factory | 1 | 1.3 | 1.8 | 1.3 |
191-
| Dereference owner | 1 | 1 | 1 | 1 |
192-
| Create observer empty | 1 | 1.2 | 1.2 | 1.3 |
193-
| Create observer | 1 | 1.5 | 1.6 | 1.6 |
194-
| Create observer copy | 1 | 1.7 | 1.7 | 1.7 |
195-
| Dereference observer | 1 | 4.8 | 1.2 | 1.3 |
196-
197-
*Compiler: MSVC 16.11.3, std: MS-STL, OS: Windows 10.0.19043, CPU: i7-7800x:*
195+
*Compiler: MSVC 16.11.3, std: MS-STL, oup: 0.4.0, OS: Windows 10.0.19043, CPU: i7-7800x:*
198196

199197
| Pointer | raw/unique | weak/shared | observer/obs_unique | observer/obs_sealed |
200198
|--------------------------|------------|-------------|---------------------|---------------------|
@@ -207,7 +205,7 @@ The benchmarks were last ran for v0.4.0.
207205
| Create observer copy | 1 | 6.2 | 1.4 | 1.3 |
208206
| Dereference observer | 1 | 11 | 1.5 | 1.1 |
209207

210-
*Compiler: Emscripten 2.0.16, std: libc++, OS: Node.js 14.15.5 + linux kernel 5.1.0, CPU: Ryzen 5 2600:*
208+
*Compiler: Emscripten 2.0.16, std: libc++, oup: 0.4.0, OS: Node.js 14.15.5 + linux kernel 5.1.0, CPU: Ryzen 5 2600:*
211209

212210
| Pointer | raw/unique | weak/shared | observer/obs_unique | observer/obs_sealed |
213211
|--------------------------|------------|-------------|---------------------|---------------------|

0 commit comments

Comments
 (0)