-
Notifications
You must be signed in to change notification settings - Fork 0
/
value_variant_any.txt
53 lines (48 loc) · 2.67 KB
/
value_variant_any.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
std::variant<int, double, CopyableUniquePtr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > size 16
std::variant<int, double, std::shared_ptr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > size 24
std::variant<int, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool> size 40
std::variant<int, int, short> size 8
std::tuple<int, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > size 48
std::any size 16
std::optional<long> size 16
std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > size 40
std::unique_ptr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::default_delete<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > size 8
user cpu : 0s 0us
sys cpu : 0s 6091us
max rss : 40948 KB / 39.9883 MB
page reclaims : 552
page faults : 0
voluntary switches : 0
involuntary switches : 0
user cpu : 0s 0us
sys cpu : 0s 4217us
max rss : 16420 KB / 16.0352 MB
page reclaims : 544
page faults : 0
voluntary switches : 0
involuntary switches : 0
1234567890123456
1234567890123456
2023-06-11T21:34:40+08:00
Running ./bin/value_variant_any
Run on (8 X 2904 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x8)
L1 Instruction 32 KiB (x8)
L2 Unified 256 KiB (x8)
L3 Unified 16384 KiB (x1)
Load Average: 4.12, 4.54, 3.26
-------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------------------------------
BM_Variant<std::string> 20.1 ns 20.4 ns 30982293
BM_Variant<std::unique_ptr<std::string>> 24.5 ns 24.8 ns 29098488
BM_Variant<std::shared_ptr<std::string>> 27.3 ns 27.5 ns 26509199
BM_Variant<std::optional<std::string>> 21.8 ns 22.0 ns 32048480
BM_Variant<CopyableUniquePtr<std::string>> 30.2 ns 30.4 ns 22510748
BM_Variant<int64_t> 0.463 ns 0.465 ns 1000000000
BM_Any 31.2 ns 31.3 ns 24099878
BM_AnyPod 2.18 ns 2.18 ns 325307494
BM_Optional 14.2 ns 14.2 ns 47487623
BM_CopyableUniquePtrInt 0.487 ns 0.487 ns 1000000000
BM_CopyableUniquePtrString 30.9 ns 30.9 ns 21965480