mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-06 10:46:18 +08:00
Added the rfl::NoFieldNames processor (#121)
This commit is contained in:
@@ -64,6 +64,18 @@ static void BM_person_write_reflect_cpp_cbor(benchmark::State &state) {
|
||||
}
|
||||
BENCHMARK(BM_person_write_reflect_cpp_cbor);
|
||||
|
||||
static void BM_person_write_reflect_cpp_cbor_without_field_names(
|
||||
benchmark::State &state) {
|
||||
const auto data = load_data();
|
||||
for (auto _ : state) {
|
||||
const auto output = rfl::cbor::write<rfl::NoFieldNames>(data);
|
||||
if (output.size() == 0) {
|
||||
std::cout << "No output" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_person_write_reflect_cpp_cbor_without_field_names);
|
||||
|
||||
static void BM_person_write_reflect_cpp_flexbuf(benchmark::State &state) {
|
||||
const auto data = load_data();
|
||||
for (auto _ : state) {
|
||||
@@ -75,6 +87,18 @@ static void BM_person_write_reflect_cpp_flexbuf(benchmark::State &state) {
|
||||
}
|
||||
BENCHMARK(BM_person_write_reflect_cpp_flexbuf);
|
||||
|
||||
static void BM_person_write_reflect_cpp_flexbuf_without_field_names(
|
||||
benchmark::State &state) {
|
||||
const auto data = load_data();
|
||||
for (auto _ : state) {
|
||||
const auto output = rfl::flexbuf::write<rfl::NoFieldNames>(data);
|
||||
if (output.size() == 0) {
|
||||
std::cout << "No output" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_person_write_reflect_cpp_flexbuf_without_field_names);
|
||||
|
||||
static void BM_person_write_reflect_cpp_json(benchmark::State &state) {
|
||||
const auto data = load_data();
|
||||
for (auto _ : state) {
|
||||
@@ -86,6 +110,18 @@ static void BM_person_write_reflect_cpp_json(benchmark::State &state) {
|
||||
}
|
||||
BENCHMARK(BM_person_write_reflect_cpp_json);
|
||||
|
||||
static void BM_person_write_reflect_cpp_json_without_field_names(
|
||||
benchmark::State &state) {
|
||||
const auto data = load_data();
|
||||
for (auto _ : state) {
|
||||
const auto output = rfl::json::write<rfl::NoFieldNames>(data);
|
||||
if (output.size() == 0) {
|
||||
std::cout << "No output" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_person_write_reflect_cpp_json_without_field_names);
|
||||
|
||||
static void BM_person_write_reflect_cpp_msgpack(benchmark::State &state) {
|
||||
const auto data = load_data();
|
||||
for (auto _ : state) {
|
||||
@@ -97,6 +133,18 @@ static void BM_person_write_reflect_cpp_msgpack(benchmark::State &state) {
|
||||
}
|
||||
BENCHMARK(BM_person_write_reflect_cpp_msgpack);
|
||||
|
||||
static void BM_person_write_reflect_cpp_msgpack_without_field_names(
|
||||
benchmark::State &state) {
|
||||
const auto data = load_data();
|
||||
for (auto _ : state) {
|
||||
const auto output = rfl::msgpack::write<rfl::NoFieldNames>(data);
|
||||
if (output.size() == 0) {
|
||||
std::cout << "No output" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_person_write_reflect_cpp_msgpack_without_field_names);
|
||||
|
||||
static void BM_person_write_reflect_cpp_toml(benchmark::State &state) {
|
||||
const auto data = load_data();
|
||||
for (auto _ : state) {
|
||||
|
||||
Reference in New Issue
Block a user