Added support for Apache Avro, and thus for schemaful formats (#303)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2024-12-22 14:53:25 +01:00
committed by GitHub
parent a1920a1e30
commit e46835287f
114 changed files with 4750 additions and 261 deletions
+13
View File
@@ -3,6 +3,7 @@
#include <array>
#include <iostream>
#include <optional>
#include <rfl/avro.hpp>
#include <rfl/bson.hpp>
#include <rfl/cbor.hpp>
#include <rfl/flexbuf.hpp>
@@ -47,6 +48,18 @@ static FeatureCollection load_data() {
// ----------------------------------------------------------------------------
static void BM_canada_write_reflect_cpp_avro(benchmark::State &state) {
const auto schema = rfl::avro::to_schema<FeatureCollection>();
const auto data = load_data();
for (auto _ : state) {
const auto output = rfl::avro::write(data, schema);
if (output.size() == 0) {
std::cout << "No output" << std::endl;
}
}
}
BENCHMARK(BM_canada_write_reflect_cpp_avro);
static void BM_canada_write_reflect_cpp_bson(benchmark::State &state) {
const auto data = load_data();
for (auto _ : state) {