| 177 | } |
| 178 | |
| 179 | void 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 | |
| 204 | void BM_STR_timSort(uint32_t iterations) { |
| 205 | folly::BenchmarkSuspender suspender; |
nothing calls this directly
no test coverage detected