mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-03 08:46:19 +08:00
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user