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)
8080 });
8181}
8282
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+
83107#define PREVECTOR_TEST (name ) \
84108 static void Prevector##name##Nontrivial(benchmark::Bench& bench) \
85109 { \
@@ -96,3 +120,5 @@ PREVECTOR_TEST(Clear)
96120PREVECTOR_TEST(Destructor)
97121PREVECTOR_TEST(Resize)
98122PREVECTOR_TEST(Deserialize)
123+ PREVECTOR_TEST(FillVectorDirect)
124+ PREVECTOR_TEST(FillVectorIndirect)
You can’t perform that action at this time.
0 commit comments