MCPcopy Create free account
hub / github.com/bytedance/bolt / BM_STR_stdSort

Function BM_STR_stdSort

bolt/exec/benchmarks/RowContainerSortBenchmark.cpp:179–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void BM_STR_stdSort(uint32_t iterations) {
180 folly::BenchmarkSuspender suspender;
181 auto pool = memory::memoryManager()->addLeafPool();
182 VectorMaker vectorMaker(pool.get());
183 auto data = getDataFromFile();
184 auto vector =
185 vectorMaker.encodedVector<StringView>(VectorEncoding::Simple::FLAT, data);
186 DecodedVector decoded(*vector);
187 // Create row container.
188 std::vector<TypePtr> types{vector->type()};
189 // Store the vector in the rowContainer.
190 auto rowContainer =
191 std::make_unique<bolt::exec::RowContainer>(types, pool.get());
192 int size = data.size();
193 auto rows = store(*rowContainer, decoded, size);
194 for (size_t k = 0; k < iterations; ++k) {
195 suspender.dismiss();
196 std::sort(
197 rows.begin(), rows.end(), [&](const char* left, const char* right) {
198 return rowContainer->compareRows(left, right) < 0;
199 });
200 suspender.rehire();
201 }
202}
203
204void BM_STR_timSort(uint32_t iterations) {
205 folly::BenchmarkSuspender suspender;

Callers

nothing calls this directly

Calls 10

memoryManagerFunction · 0.85
getDataFromFileFunction · 0.85
addLeafPoolMethod · 0.80
compareRowsMethod · 0.80
storeFunction · 0.70
getMethod · 0.45
typeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected