Added support for Cap'n Proto (#323)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2025-01-06 15:12:40 +01:00
committed by GitHub
parent 6b63b41b81
commit 1d58526869
111 changed files with 4035 additions and 171 deletions
+13
View File
@@ -5,6 +5,7 @@
#include <optional>
#include <rfl/avro.hpp>
#include <rfl/bson.hpp>
#include <rfl/capnproto.hpp>
#include <rfl/cbor.hpp>
#include <rfl/flexbuf.hpp>
#include <rfl/json.hpp>
@@ -71,6 +72,18 @@ static void BM_canada_write_reflect_cpp_bson(benchmark::State &state) {
}
BENCHMARK(BM_canada_write_reflect_cpp_bson);
static void BM_canada_write_reflect_cpp_capnproto(benchmark::State &state) {
const auto schema = rfl::capnproto::to_schema<FeatureCollection>();
const auto data = load_data();
for (auto _ : state) {
const auto output = rfl::capnproto::write(data, schema);
if (output.size() == 0) {
std::cout << "No output" << std::endl;
}
}
}
BENCHMARK(BM_canada_write_reflect_cpp_capnproto);
static void BM_canada_write_reflect_cpp_cbor(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {