mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-06 18:56:19 +08:00
Added the rfl::NoFieldNames processor (#121)
This commit is contained in:
@@ -68,6 +68,19 @@ static void BM_canada_read_reflect_cpp_cbor(benchmark::State &state) {
|
||||
}
|
||||
BENCHMARK(BM_canada_read_reflect_cpp_cbor);
|
||||
|
||||
static void BM_canada_read_reflect_cpp_cbor_without_field_names(
|
||||
benchmark::State &state) {
|
||||
const auto data = rfl::cbor::write<rfl::NoFieldNames>(load_data());
|
||||
for (auto _ : state) {
|
||||
const auto res =
|
||||
rfl::cbor::read<FeatureCollection, rfl::NoFieldNames>(data);
|
||||
if (!res) {
|
||||
std::cout << res.error()->what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_canada_read_reflect_cpp_cbor_without_field_names);
|
||||
|
||||
static void BM_canada_read_reflect_cpp_flexbuf(benchmark::State &state) {
|
||||
const auto data = rfl::flexbuf::write(load_data());
|
||||
for (auto _ : state) {
|
||||
@@ -79,6 +92,19 @@ static void BM_canada_read_reflect_cpp_flexbuf(benchmark::State &state) {
|
||||
}
|
||||
BENCHMARK(BM_canada_read_reflect_cpp_flexbuf);
|
||||
|
||||
static void BM_canada_read_reflect_cpp_flexbuf_without_field_names(
|
||||
benchmark::State &state) {
|
||||
const auto data = rfl::flexbuf::write<rfl::NoFieldNames>(load_data());
|
||||
for (auto _ : state) {
|
||||
const auto res =
|
||||
rfl::flexbuf::read<FeatureCollection, rfl::NoFieldNames>(data);
|
||||
if (!res) {
|
||||
std::cout << res.error()->what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_canada_read_reflect_cpp_flexbuf_without_field_names);
|
||||
|
||||
static void BM_canada_read_reflect_cpp_json(benchmark::State &state) {
|
||||
const auto data = rfl::json::write(load_data());
|
||||
for (auto _ : state) {
|
||||
@@ -90,6 +116,19 @@ static void BM_canada_read_reflect_cpp_json(benchmark::State &state) {
|
||||
}
|
||||
BENCHMARK(BM_canada_read_reflect_cpp_json);
|
||||
|
||||
static void BM_canada_read_reflect_cpp_json_without_field_names(
|
||||
benchmark::State &state) {
|
||||
const auto data = rfl::json::write<rfl::NoFieldNames>(load_data());
|
||||
for (auto _ : state) {
|
||||
const auto res =
|
||||
rfl::json::read<FeatureCollection, rfl::NoFieldNames>(data);
|
||||
if (!res) {
|
||||
std::cout << res.error()->what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_canada_read_reflect_cpp_json_without_field_names);
|
||||
|
||||
static void BM_canada_read_reflect_cpp_msgpack(benchmark::State &state) {
|
||||
const auto data = rfl::msgpack::write(load_data());
|
||||
for (auto _ : state) {
|
||||
@@ -101,6 +140,19 @@ static void BM_canada_read_reflect_cpp_msgpack(benchmark::State &state) {
|
||||
}
|
||||
BENCHMARK(BM_canada_read_reflect_cpp_msgpack);
|
||||
|
||||
static void BM_canada_read_reflect_cpp_msgpack_without_field_names(
|
||||
benchmark::State &state) {
|
||||
const auto data = rfl::msgpack::write<rfl::NoFieldNames>(load_data());
|
||||
for (auto _ : state) {
|
||||
const auto res =
|
||||
rfl::msgpack::read<FeatureCollection, rfl::NoFieldNames>(data);
|
||||
if (!res) {
|
||||
std::cout << res.error()->what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_canada_read_reflect_cpp_msgpack_without_field_names);
|
||||
|
||||
static void BM_canada_read_reflect_cpp_toml(benchmark::State &state) {
|
||||
const auto data = rfl::toml::write(load_data());
|
||||
for (auto _ : state) {
|
||||
|
||||
Reference in New Issue
Block a user