Added support for UBJSON; resolves #245 (#251)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2024-11-10 11:38:00 +01:00
committed by GitHub
parent 716de7b6fd
commit b71f82b4f1
66 changed files with 2277 additions and 11 deletions
+24
View File
@@ -9,6 +9,7 @@
#include <rfl/json.hpp>
#include <rfl/msgpack.hpp>
#include <rfl/toml.hpp>
#include <rfl/ubjson.hpp>
#include <rfl/yaml.hpp>
#include <type_traits>
#include <vector>
@@ -149,6 +150,29 @@ static void BM_canada_write_reflect_cpp_toml(benchmark::State &state) {
}
BENCHMARK(BM_canada_write_reflect_cpp_toml);
static void BM_canada_write_reflect_cpp_ubjson(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {
const auto output = rfl::ubjson::write(data);
if (output.size() == 0) {
std::cout << "No output" << std::endl;
}
}
}
BENCHMARK(BM_canada_write_reflect_cpp_ubjson);
static void BM_canada_write_reflect_cpp_ubjson_without_field_names(
benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {
const auto output = rfl::ubjson::write<rfl::NoFieldNames>(data);
if (output.size() == 0) {
std::cout << "No output" << std::endl;
}
}
}
BENCHMARK(BM_canada_write_reflect_cpp_ubjson_without_field_names);
static void BM_canada_write_reflect_cpp_yaml(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {