mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-03 00:26:19 +08:00
Added support for Apache Avro, and thus for schemaful formats (#303)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user