| 41 | #endif |
| 42 | |
| 43 | size_t init_data(const char* input = default_file) { |
| 44 | // compute the number of bytes. |
| 45 | auto compute = []() -> double { |
| 46 | size_t bytes{0}; |
| 47 | for (std::string& url_string : url_examples) { |
| 48 | bytes += url_string.size(); |
| 49 | } |
| 50 | return double(bytes); |
| 51 | }; |
| 52 | if (input == nullptr) { |
| 53 | for (const std::string& s : url_examples_default) { |
| 54 | url_examples.emplace_back(s); |
| 55 | } |
| 56 | url_examples_bytes = compute(); |
| 57 | return url_examples.size(); |
| 58 | } |
| 59 | |
| 60 | if (!file_exists(input)) { |
| 61 | std::cout << "File not found !" << input << std::endl; |
| 62 | for (const std::string& s : url_examples_default) { |
| 63 | url_examples.emplace_back(s); |
| 64 | } |
| 65 | } else { |
| 66 | std::cout << "Loading " << input << std::endl; |
| 67 | url_examples = split_string(read_file(input)); |
| 68 | } |
| 69 | url_examples_bytes = compute(); |
| 70 | return url_examples.size(); |
| 71 | } |
| 72 | |
| 73 | #ifndef BENCHMARK_PREFIX |
| 74 | #define BENCHMARK_PREFIX Bench_ |
no test coverage detected