-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (24 loc) · 831 Bytes
/
main.cpp
File metadata and controls
32 lines (24 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <chrono>
#include "csv_reader.h"
// #include "csv.hpp"
constexpr int NUM_RUNS = 5;
constexpr auto CSV_FILE = "/home/lehoai/Desktop/tmp/vehicles.csv";
long long parse_simd() {
const auto start = std::chrono::high_resolution_clock::now();
size_t totalLines = 0;
constexpr csv::format format;
csv::CsvReader reader(CSV_FILE, format);
reader.parse([&](const std::string_view* row) {
// totalBytes += row[0].size();
totalLines++;
});
std::cout << totalLines << std::endl;
const auto end = std::chrono::high_resolution_clock::now();
return std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
}
int main() {
const auto time = parse_simd();
std::cout << "| avg: " << time << "ms" << std::endl;
return 0;
}