2021-01-05 04:21:50 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#if SIMDJSON_EXCEPTIONS
|
|
|
|
|
|
|
|
#include "large_random.h"
|
|
|
|
|
|
|
|
namespace large_random {
|
|
|
|
|
|
|
|
using namespace simdjson;
|
|
|
|
|
2021-01-05 12:20:24 +08:00
|
|
|
struct simdjson_dom {
|
2021-01-07 11:58:38 +08:00
|
|
|
static constexpr diff_flags DiffFlags = diff_flags::NONE;
|
|
|
|
|
2021-01-05 04:21:50 +08:00
|
|
|
dom::parser parser{};
|
2021-01-05 12:20:24 +08:00
|
|
|
|
2021-01-06 03:31:34 +08:00
|
|
|
bool run(simdjson::padded_string &json, std::vector<point> &result) {
|
2021-01-05 04:21:50 +08:00
|
|
|
for (auto point : parser.parse(json)) {
|
2021-01-07 11:58:38 +08:00
|
|
|
result.emplace_back(json_benchmark::point{point["x"], point["y"], point["z"]});
|
2021-01-05 04:21:50 +08:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-01-06 02:45:49 +08:00
|
|
|
BENCHMARK_TEMPLATE(large_random, simdjson_dom)->UseManualTime();
|
2021-01-05 04:21:50 +08:00
|
|
|
|
|
|
|
} // namespace large_random
|
|
|
|
|
|
|
|
#endif // SIMDJSON_EXCEPTIONS
|