Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the rfl::NoFieldNames processor #121

Merged
merged 12 commits into from
Jun 18, 2024
52 changes: 52 additions & 0 deletions benchmarks/all/canada_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
43 changes: 40 additions & 3 deletions benchmarks/all/canada_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,29 @@ static void BM_canada_write_reflect_cpp_cbor(benchmark::State &state) {
}
BENCHMARK(BM_canada_write_reflect_cpp_cbor);

static void BM_canada_write_reflect_cpp_flexbuf(benchmark::State &state) {
static void BM_canada_write_reflect_cpp_cbor_without_field_names(
benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {
const auto output = rfl::flexbuf::write(data);
const auto output = rfl::cbor::write<rfl::NoFieldNames>(data);
if (output.size() == 0) {
std::cout << "No output" << std::endl;
}
}
}
BENCHMARK(BM_canada_write_reflect_cpp_flexbuf);
BENCHMARK(BM_canada_write_reflect_cpp_cbor_without_field_names);

static void BM_canada_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_canada_write_reflect_cpp_flexbuf_without_field_names);

static void BM_canada_write_reflect_cpp_json(benchmark::State &state) {
const auto data = load_data();
Expand All @@ -90,6 +103,18 @@ static void BM_canada_write_reflect_cpp_json(benchmark::State &state) {
}
BENCHMARK(BM_canada_write_reflect_cpp_json);

static void BM_canada_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_canada_write_reflect_cpp_json_without_field_names);

static void BM_canada_write_reflect_cpp_msgpack(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {
Expand All @@ -101,6 +126,18 @@ static void BM_canada_write_reflect_cpp_msgpack(benchmark::State &state) {
}
BENCHMARK(BM_canada_write_reflect_cpp_msgpack);

static void BM_canada_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_canada_write_reflect_cpp_msgpack_without_field_names);

static void BM_canada_write_reflect_cpp_toml(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {
Expand Down
48 changes: 48 additions & 0 deletions benchmarks/all/licenses_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ static void BM_licenses_read_reflect_cpp_cbor(benchmark::State &state) {
}
BENCHMARK(BM_licenses_read_reflect_cpp_cbor);

static void BM_licenses_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<Licenses, rfl::NoFieldNames>(data);
if (!res) {
std::cout << res.error()->what() << std::endl;
}
}
}
BENCHMARK(BM_licenses_read_reflect_cpp_cbor_without_field_names);

static void BM_licenses_read_reflect_cpp_flexbuf(benchmark::State &state) {
const auto data = rfl::flexbuf::write(load_data());
for (auto _ : state) {
Expand All @@ -95,6 +107,18 @@ static void BM_licenses_read_reflect_cpp_flexbuf(benchmark::State &state) {
}
BENCHMARK(BM_licenses_read_reflect_cpp_flexbuf);

static void BM_licenses_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<Licenses, rfl::NoFieldNames>(data);
if (!res) {
std::cout << res.error()->what() << std::endl;
}
}
}
BENCHMARK(BM_licenses_read_reflect_cpp_flexbuf_without_field_names);

static void BM_licenses_read_reflect_cpp_json(benchmark::State &state) {
const auto data = rfl::json::write(load_data());
for (auto _ : state) {
Expand All @@ -106,6 +130,18 @@ static void BM_licenses_read_reflect_cpp_json(benchmark::State &state) {
}
BENCHMARK(BM_licenses_read_reflect_cpp_json);

static void BM_licenses_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<Licenses, rfl::NoFieldNames>(data);
if (!res) {
std::cout << res.error()->what() << std::endl;
}
}
}
BENCHMARK(BM_licenses_read_reflect_cpp_json_without_field_names);

static void BM_licenses_read_reflect_cpp_msgpack(benchmark::State &state) {
const auto data = rfl::msgpack::write(load_data());
for (auto _ : state) {
Expand All @@ -117,6 +153,18 @@ static void BM_licenses_read_reflect_cpp_msgpack(benchmark::State &state) {
}
BENCHMARK(BM_licenses_read_reflect_cpp_msgpack);

static void BM_licenses_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<Licenses, rfl::NoFieldNames>(data);
if (!res) {
std::cout << res.error()->what() << std::endl;
}
}
}
BENCHMARK(BM_licenses_read_reflect_cpp_msgpack_without_field_names);

static void BM_licenses_read_reflect_cpp_xml(benchmark::State &state) {
const auto data = rfl::xml::write<"license">(load_data());
for (auto _ : state) {
Expand Down
48 changes: 48 additions & 0 deletions benchmarks/all/licenses_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ static void BM_licenses_write_reflect_cpp_cbor(benchmark::State &state) {
}
BENCHMARK(BM_licenses_write_reflect_cpp_cbor);

static void BM_licenses_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_licenses_write_reflect_cpp_cbor_without_field_names);

static void BM_licenses_write_reflect_cpp_flexbuf(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {
Expand All @@ -95,6 +107,18 @@ static void BM_licenses_write_reflect_cpp_flexbuf(benchmark::State &state) {
}
BENCHMARK(BM_licenses_write_reflect_cpp_flexbuf);

static void BM_licenses_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_licenses_write_reflect_cpp_flexbuf_without_field_names);

static void BM_licenses_write_reflect_cpp_json(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {
Expand All @@ -106,6 +130,18 @@ static void BM_licenses_write_reflect_cpp_json(benchmark::State &state) {
}
BENCHMARK(BM_licenses_write_reflect_cpp_json);

static void BM_licenses_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_licenses_write_reflect_cpp_json_without_field_names);

static void BM_licenses_write_reflect_cpp_msgpack(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {
Expand All @@ -117,6 +153,18 @@ static void BM_licenses_write_reflect_cpp_msgpack(benchmark::State &state) {
}
BENCHMARK(BM_licenses_write_reflect_cpp_msgpack);

static void BM_licenses_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_licenses_write_reflect_cpp_msgpack_without_field_names);

static void BM_licenses_write_reflect_cpp_toml(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {
Expand Down
48 changes: 48 additions & 0 deletions benchmarks/all/person_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ static void BM_person_read_reflect_cpp_cbor(benchmark::State &state) {
}
BENCHMARK(BM_person_read_reflect_cpp_cbor);

static void BM_person_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<Person, rfl::NoFieldNames>(data);
if (!res) {
std::cout << res.error()->what() << std::endl;
}
}
}
BENCHMARK(BM_person_read_reflect_cpp_cbor_without_field_names);

static void BM_person_read_reflect_cpp_flexbuf(benchmark::State &state) {
const auto data = rfl::flexbuf::write(load_data());
for (auto _ : state) {
Expand All @@ -75,6 +87,18 @@ static void BM_person_read_reflect_cpp_flexbuf(benchmark::State &state) {
}
BENCHMARK(BM_person_read_reflect_cpp_flexbuf);

static void BM_person_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<Person, rfl::NoFieldNames>(data);
if (!res) {
std::cout << res.error()->what() << std::endl;
}
}
}
BENCHMARK(BM_person_read_reflect_cpp_flexbuf_without_field_names);

static void BM_person_read_reflect_cpp_json(benchmark::State &state) {
const auto data = rfl::json::write(load_data());
for (auto _ : state) {
Expand All @@ -86,6 +110,18 @@ static void BM_person_read_reflect_cpp_json(benchmark::State &state) {
}
BENCHMARK(BM_person_read_reflect_cpp_json);

static void BM_person_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<Person, rfl::NoFieldNames>(data);
if (!res) {
std::cout << res.error()->what() << std::endl;
}
}
}
BENCHMARK(BM_person_read_reflect_cpp_json_without_field_names);

static void BM_person_read_reflect_cpp_msgpack(benchmark::State &state) {
const auto data = rfl::msgpack::write(load_data());
for (auto _ : state) {
Expand All @@ -97,6 +133,18 @@ static void BM_person_read_reflect_cpp_msgpack(benchmark::State &state) {
}
BENCHMARK(BM_person_read_reflect_cpp_msgpack);

static void BM_person_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<Person, rfl::NoFieldNames>(data);
if (!res) {
std::cout << res.error()->what() << std::endl;
}
}
}
BENCHMARK(BM_person_read_reflect_cpp_msgpack_without_field_names);

static void BM_person_read_reflect_cpp_toml(benchmark::State &state) {
const auto data = rfl::toml::write(load_data());
for (auto _ : state) {
Expand Down
Loading
Loading