| 202 | } |
| 203 | |
| 204 | void 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 | |
| 230 | BENCHMARK_NAMED_PARAM(BM_Int64_stdSort, 100k_uni_noseq, 100000); |
nothing calls this directly
no test coverage detected