File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,30 @@ static void PrevectorDeserialize(benchmark::Bench& bench)
80
80
});
81
81
}
82
82
83
+ template <typename T>
84
+ static void PrevectorFillVectorDirect (benchmark::Bench& bench)
85
+ {
86
+ bench.run ([&] {
87
+ std::vector<prevector<28 , T>> vec;
88
+ for (size_t i = 0 ; i < 260 ; ++i) {
89
+ vec.emplace_back ();
90
+ }
91
+ });
92
+ }
93
+
94
+
95
+ template <typename T>
96
+ static void PrevectorFillVectorIndirect (benchmark::Bench& bench)
97
+ {
98
+ bench.run ([&] {
99
+ std::vector<prevector<28 , T>> vec;
100
+ for (size_t i = 0 ; i < 260 ; ++i) {
101
+ // force allocation
102
+ vec.emplace_back (29 , T{});
103
+ }
104
+ });
105
+ }
106
+
83
107
#define PREVECTOR_TEST (name ) \
84
108
static void Prevector##name##Nontrivial(benchmark::Bench& bench) \
85
109
{ \
@@ -96,3 +120,5 @@ PREVECTOR_TEST(Clear)
96
120
PREVECTOR_TEST(Destructor)
97
121
PREVECTOR_TEST(Resize)
98
122
PREVECTOR_TEST(Deserialize)
123
+ PREVECTOR_TEST(FillVectorDirect)
124
+ PREVECTOR_TEST(FillVectorIndirect)
You can’t perform that action at this time.
0 commit comments