mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
29 lines
615 B
C++
29 lines
615 B
C++
#pragma once
|
|
|
|
#if SIMDJSON_EXCEPTIONS
|
|
|
|
#include "large_random.h"
|
|
|
|
namespace large_random {
|
|
|
|
using namespace simdjson;
|
|
using namespace simdjson::builtin;
|
|
|
|
struct simdjson_ondemand_unordered {
|
|
ondemand::parser parser{};
|
|
|
|
bool run(const simdjson::padded_string &json, std::vector<point> &points) {
|
|
auto doc = parser.iterate(json);
|
|
for (ondemand::object coord : doc) {
|
|
points.emplace_back(large_random::point{coord["x"], coord["y"], coord["z"]});
|
|
}
|
|
return true;
|
|
}
|
|
};
|
|
|
|
BENCHMARK_TEMPLATE(large_random, simdjson_ondemand_unordered);
|
|
|
|
} // namespace large_random
|
|
|
|
#endif // SIMDJSON_EXCEPTIONS
|