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

Function BM_STR_timSort

bolt/exec/benchmarks/RowContainerSortBenchmark.cpp:204–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void BM_STR_timSort(uint32_t iterations) {
205 folly::BenchmarkSuspender suspender;
206 auto pool = memory::memoryManager()->addLeafPool();
207 VectorMaker vectorMaker(pool.get());
208 auto data = getDataFromFile();
209 auto vector =
210 vectorMaker.encodedVector<StringView>(VectorEncoding::Simple::FLAT, data);
211 DecodedVector decoded(*vector);
212 // Create row container.
213 std::vector<TypePtr> types{vector->type()};
214 // Store the vector in the rowContainer.
215 auto rowContainer =
216 std::make_unique<bolt::exec::RowContainer>(types, pool.get());
217 int size = vector->size();
218 auto rows = store(*rowContainer, decoded, size);
219 for (size_t k = 0; k < iterations; ++k) {
220 suspender.dismiss();
221 gfx::timsort(
222 rows.begin(), rows.end(), [&](const char* left, const char* right) {
223 return rowContainer->compareRows(left, right) < 0;
224 });
225 suspender.rehire();
226 }
227}
228} // namespace
229
230BENCHMARK_NAMED_PARAM(BM_Int64_stdSort, 100k_uni_noseq, 100000);

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